Home  >  Article  >  Backend Development  >  Application of session login page in PHP4 by vanessa anne hudgens

Application of session login page in PHP4 by vanessa anne hudgens

WBOY
WBOYOriginal
2016-07-29 08:38:26950browse

//这个脚本是用来给用户输入口令,并判断口令是否正确的。
//如果正确则转到欢迎页面。
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="对不起,您没有订票的权限!";
}
}
else{
$error_message="错误!用户名错,或口令错。请重新输入。";
}
$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");
}
?>



    用户登录



 



  
     
      
    
    
      
    
  
 
        
用户登录

      

        
           
            
             
              ">
            
          

           
             
              口令:
            
             
              
            
          

           
             
               
                
                
              
            
          

        
 
              
用户:

            

      


if($error_message) echo "
$error_message
";
?>
document.form1.user_login.focus();

 





以上就介绍了vanessa anne hudgens PHP4中session登录页面的应用,包括了vanessa anne hudgens方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn