Přihlášen jako:
query("INSERT INTO user (username, password) VALUES (\"" . $safe_uname . "\",\"" . $hashed_pass ."\")");
login($safe_uname);
} else
{
$res = $database -> query("SELECT username, password FROM user WHERE username=\"" . $safe_uname . "\" AND password = \"" . $hashed_pass . "\"");
if ($res -> num_rows == 1)
{
login($safe_uname);
} else
{
echo "";
}
}
}
function login($uname)
{
if ($uname != null)
{
$_SESSION["username"] = $uname;
} else
{
$uname = $_SESSION["username"];
}
echo "";
}
?>