15.06.2015, 08:44
This?
You can also use it hash("sha512"..) or MD5 to have your peace of mind from hacks accounts.
Код:
<?php
session_start();
if(isset($_POST['login'])){
if($_POST['user'] && $_POST['password']){
include ("variables.php");
$connection = mysql_connect ($dbservername, $dbusername, $dbpassword);
mysql_select_db($dbname, $connection);
if (!isset($_SESSION["username"]))
{
$username = mysql_escape_string($_POST["user"]);
$password = mysql_escape_string($_POST["password"]);
}
else $username = mysql_escape_string($_SESSION["username"]);
....
}
else{
echo "There was no values for username or password posted!!";
}
}
....
?>

