Use ajax to verify the user name and password, and use ajax to verify the user name. Ajax authentication username and password. ajax authentication username 1varuserform. name. value; 2varpasswordform. password. value; 3varurlchkname. php? User + password; ajax authentication username and password, ajax authentication username
1 var user = form. name. value; 2 var password = form. password. value; 3 var url = "chkname. php? User = "+ user +" & password = "+ password; // previously, I only knew that ajax was used to detect the user name. in the past, I could also detect the password. 4 xmlhttp. open ("GET", url, true); 5 xmlhttp. onreadystatechange = function () {6 if (xmlhttp. readyState = 4) {7 var msg = xmlhttp. responseText; 8 if (msg = '1') {9 alert ('user name or password error !! '); 10 form. password. select (); 11 form. check. value = ''; 12 code (form); 13 return false; 14} if (msg =" 3 ") {15 alert (" username occupied, please enter it again! "); 16 return false; 17} else {18 alert ('Welcome '); 19 location. reload (); 20} 21} 22} 23 xmlhttp. send (null); 24 return false;
Php uses ajax to verify the user name and the user in the database
Step 1: a jq js file
Login </title>