Location: PHPKode > projects > The DVD Database Project > verify.php
<?PHP 
require("common.php");
include("function.php");

$name = strtolower($name); // make lowercase
$query_string = "SELECT * FROM user WHERE name =" ."'" .$name ."'";
$result = runquery($query_string);
$found = mysql_fetch_row($result);
if (md5($pass)==$found[1]){
session_start();
$time = time() + $timeout_in_seconds;
session_unregister("name");
session_register("time");
session_register("name");
$location=$found[3];
session_register("location");
$email=$found[4];
session_register("email");

$query_string= "UPDATE user SET lastvisit=now() WHERE name =" ."'" .$name ."'";
runquery($query_string); // update lastvisit

logfile("$name logged in"); // log "user login"

$head = sprintf("Location: %s/welcome.php?order=order+by+title+ASC", $path);
header($head);
exit;
}else{

logfile("$name tried to log in");

$head = sprintf("Location: %s/loginfail.html", $path);
header($head);

exit;
}

?>
Return current item: The DVD Database Project