Application of Session login page in PHP4 _php tutorial

Source: Internet
Author: User
This script is used to enter a password for the user and to determine if the password is correct.
If it is correct, go to the Welcome page.
if ($login) {
Include (".. /include/config.inc.php3 ");
Session_Start ();
$right _enter= ' 0 ';
$query = "SELECT * from User_define where user_login= ' $user _login ' and User_pass=password (' $user _pass ')";
$result = @mysql_query ($query, $dbconnect);
if ($user _array= @mysql_fetch_array ($result)) {
$user _id= $user _array[user_id];
$user _name= $user _array[user_info];
Session_register ("user_id");
Session_register ("user_name");
Session_register ("User_array");
if (($user _array[ticket_day]) and ($user _array[ticket_num]) {
$right _enter= ' 1 ';
}
else{
$error _message= "Sorry, you don't have permission to book tickets! ";
}
}
else{
$error _message= "Error! The user name is wrong, or the password is wrong. Please re-enter. ";
}
$log _time=date ("y-m-d h:i:s");
$query = "INSERT into Log_record (log_time,user_login,remote_addr,right_enter,enter_function) VALUES (' $log _time ', ' $ User_login ', ' $REMOTE _addr ', ' $right _enter ', ' 1 ');
@mysql_query ($query, $dbconnect);
if ($right _enter) {
Header ("Location:welcome_reserve.php3");
Exit
}
}
if ($logout) {
Session_Start ();
Session_unregister ("user_id");
Session_unregister ("user_name");
Session_unregister ("User_array");
}
?>




<title>User Login</title>






if ($error _message) echo " $error _message ";
?>





http://www.bkjia.com/PHPjc/319165.html www.bkjia.com true http://www.bkjia.com/PHPjc/319165.html techarticle ? PHP//This script is used to enter a password for the user and to determine whether the password is correct. If it is correct, go to the Welcome page. if ($login) {include (".. /include/config.inc.php3 "); Sessi ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.