Use Ajax to verify the user name and instance code.
The username verification code using Ajax is as follows:
Interface:
Getguestbook/index. phpm: indexa: verifyUserNameusername: User name to be verified
Return
{Code: returned information code 0 = No error, 1 = error message: Specific returned information}
Js
OUsername1.onblur = function () {// when the focus is lost, the current user name is sent to the backend to verify ajax ('get', 'guestbook/index. php','m = index & a = verifyUserName & username = '+ this. value, function (data) {// alert (data); view var d = JSON in browser debugging. parse (data); // parse oVerifyUserNameMsg. innerHTML = d. message; // display the returned information to the page if (d. code) {// code: returned information code 0 = No error, 1 = Error oVerifyUserNameMsg. style. color = 'red'; // red for the error message} else {oVerifyUserNameMsg. style. color = 'green'; // Add the correct information to green }});}
I would like to share with you so much about the ajax verification username instance code, and hope to help you!