Login
Require ". /include/dbclass.php ";
$username =$_post[' username '];
$password =$_post[' password '];
if (Empty ($username) | | empty ($password)) {
Go_msg ("Please fill in the user name, 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 ("The registered user has not passed the administrator audit or user name and password does not match!") 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 ("Landing success!") ",".. /user2/default_1.php ");
}
if ($_session["usertype"]==3) {
Go_msg ("Landing success!") ",".. /user3/default_2.php ");
}
Header (' Location:default.php ');
}
Dbclose ();
?>
http://www.bkjia.com/PHPjc/317772.html www.bkjia.com true http://www.bkjia.com/PHPjc/317772.html techarticle login? php require ". /include/dbclass.php "; $username =$_post[' username ']; $password =$_post[' password ']; if (Empty ($username) | | Empty ($password)) {go_msg ("Please fill in the user name, password!") ...