User login is the user entered the user name password click on the login page does not refresh and then use Ajax submitted to the background program to determine if the login successfully returned TRUE or related user information, so that the user has no refresh login effect.
PHP Jquery No flush login, write yourself a very simple
Added a judgment is that if it is already logged in, after the refresh is still displayed the login status
Login Page File
HTML page
| The code is as follows |
Copy Code |
|
Send To File
| The code is as follows |
Copy Code |
Session_Start (); Require "conn.php"; $username =$_post[' writer ']; $password =$_post[' pass '; mysql_select_db ($database _lr, $LR); $sql = "SELECT * from admin WHERE username= ' $username ' and password= ' $password '"; $result = mysql_query ($sql); if (mysql_num_rows ($result) >0) { Login sucess $_session[' login_admin ']= "Admin"; echo "Login OK"; } Else { The user ID found echo "Login failed, ID error or expired."; } ?> |
http://www.bkjia.com/PHPjc/632748.html www.bkjia.com true http://www.bkjia.com/PHPjc/632748.html techarticle User login is the user entered the user name password click on the login page does not refresh and then use Ajax submitted to the background program to determine if the login successfully returned TRUE or related user information, so ...