?
function userLogged($LogInPage)
{
//Without this, PHP will create a local
//variable called $HTTP_COOKIE_VARS.
global $HTTP_COOKIE_VARS;
$Entered_UserName = "";
$Entered_PassWord = "";
if(isset($HTTP_COOKIE_VARS["UserName"]) &&
isset($HTTP_COOKIE_VARS["PassWord"]))
{
$Entered_UserName = $HTTP_COOKIE_VARS["UserName"];
$Entered_PassWord = $HTTP_COOKIE_VARS["PassWord"];
}
$user_name_password = mysql_query("select id from users where " .
"user_name = '" . $Entered_UserName . "' and " .
"password = '" . md5($Entered_PassWord) . "'");
$user_name_password = mysql_fetch_assoc($user_name_password);
if($user_name_password === false)
{
//$LogInPage should be the name of an existing file
//with alternative web content. If you don't wish to
//provide such content, just pass the empty string.
if($LogInPage != "") include($LogInPage);
return(false);
}
else
return(true);
}
?>
Sabtu, 15 Mei 2010
Login php
by lutvi 1 comment
Langganan:
Postingan (Atom)