& Lt ;! Doctypehtmlpublic & quot;-w3cdtdxhtml10transitionalen & quot; http: wwww3orgtrxhtml1dtdxhtml1-transitionaldtd & quot; & gt; & lt; htmlxmlns & quot; http
-
-
- Ajax php users do not need to log on to the instance
- Script
- Function userlogin (){
- Var xmlhttp;
- Var str;
- Var sendstr = "";
- Try {
- Xmlhttp = new xmlhttprequest ();
- }
- Catch (e ){
- Xmlhttp = new activexobject ("microsoft. xmlhttp ");
- }
- Xmlhttp. onreadystatechange = function (){
- If (xmlhttp. readystate = 4 ){
- If (xmlhttp. status = 200 ){
- Str = xmlhttp. responsetext;
- Document. getelementbyid ("userlogin"). innerhtml = str;
- } Else {
- Alert ("system error. if you have any questions, please contact the administrator! "+ Xmlhttp. status );
- }
- }
- }
- Xmlhttp. open ("post", "config/userlogin. php", true );
- Xmlhttp. setrequestheader ('content-type', 'application/x-www-form-urlencoded ');
- Xmlhttp. send (sendstr );
- }
- Script
-
-
-
-
-
Userlogin. php file
- $ Uid = $ _ post ['uname'];
- $ Pwd = $ _ post ['upwd '];
- $ SQL = "select * from tabname where uid = '$ uid' and pwd =' $ pwd '";
- $ Query = mysql_query ($ SQL );
- If (mysql_num_rows ($ query ))
- {
- Echo 'logon successful ';
- }
- Else
- {
- Echo 'The user name or password is incorrect! ';
- }
- ?>