This example for you to share the PHP login login specific implementation code for your reference, the specific content as follows
<?php require".
/include/dbclass.php ";
$username =$_post[' username '];
$password =$_post[' password ']; if (Empty ($username) | | empty ($password)) {go_msg ("Please fill in username, password!") ","..
/default.html ");
Exit
} dbconn ();
$password =md5 ($password); $SQL = "Select Username,usertype,userpass from SiteUser where Username= '". $username. "' and userpass= '". $password.
"' and Isopen=1 ';
echo "$SQL";
$result = $db-> exec_sql ($SQL);
$total =mysql_num_rows ($result);
if ($total ==0) {dbclose (); Go_msg ("Registered user has not been audited by admin or username and password!") Please re-enter! ","..
/default.html ");
Exit
}else{$Rs = $db-> fetch_array ($result);
Attached value, and login Session_register ("username");
Session_register ("usertype");
$_session["Usertype"]= $Rs [' usertype '];
$_session["username"]= $username;
echo $_session["username"]; if ($_session["usertype"]==1) {go_msg ("Landing success!")
"," default.php ");
Header (' location:http://163.com '); } if ($_session["usertype"]==2) {go_msg ("Login successful!") ",".. /User2/default_1.php "); } if ($_session["usertype"]==3) {go_msg ("Login successful!") ","..
/user3/default_2.php ");
}//Header (' Location:default.php ');
} dbclose (); Why ask Hovertree.com?>
The above is the entire content of this article, I hope that you learn PHP program help.