PHP beginner question !! Thank you !! I learned about an open-source project on the internet. the only place for registration and verification is a bit problematic. I don't know what went wrong. JS calls php file verification but does not know why it returns 0 and does not know why there is an error. JS code: functionchkname (form) {if (form. na PHP beginner question !! Thank you !!
I learned about an open-source project on the internet. the only place for registration and verification is a bit problematic. I don't know what went wrong.
JS calls PHP file verification but does not know why it returns 0 and does not know why there is an error.
JS code:
Function chkname (form ){
If (form. name. value = "")
{
Name1.innerHTML = "enter the user name! ";
}
Else
{
Var user = form. name. value;
Var url = "chkname. php? User = "+ user;
XmlHttp. open ("GET", url, true );
XmlHttp. onreadystatechange = function ()
{
If (xmlHttp. readyState = 4)
{
Var msg = xmlHttp. responseText;
If (msg = '2 '){
Name1.innerHTML = "the user name is occupied! ";
Return false;
} Else if (msg = '1 '){
Name1.innerHTML = "Congratulations, you can register! ";
Form. c_name.value = "yes ";
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service