[Original] ajax implementation of user registration function tutorial 2 _ PHP Tutorial

Source: Internet
Author: User
[Original] Tutorial 2 on implementing the user registration function using ajax. [Original] ajax implementation of user registration function tutorial 2, this tutorial by the site original, reproduced please indicate the author: www.drise.cn mailbox: drise@163.comQQ: 271728967 above the first reg. php [original] ajax implementation user registration function tutorial 2 ','

//

This tutorial is original on this site.

Author: www.drise.cn

Email: drise@163.com

QQ: 271728967

//

The first reg. php file above has been completed, so I will do the second step.

Var xmlHttp = false;
Function ajaxcreate () {// Here is the creation of the xmlhttpt object

Try {
XmlHttp = new ActiveXObject ("Msxml2.XMLHTTP ");
} Catch (e ){

Try {
XmlHttp = new ActiveXObject ("Microsoft. XMLHTTP ");
} Catch (e2 ){

XmlHttp = false;
}

}


If (! XmlHttp & typeof XMLHttpRequest! =\\ 'Undefined \\\'){


XmlHttp = new XMLHttpRequest ();


}


If (! XmlHttp) {alert (\ 'create Xmlhttp Fail \ '); return false ;}


}

Function ajax () {// The operation to be performed after the reg. php onblur () event is received,

Ajaxcreate ();

Var xmvalue = document. getElementById ("xm"). value;


Var url = "/boke/blog/type. php? Txt = "+ encodeURI (xmvalue );


If (xmvalue = null | xmvalue. length> 20 | xmvalue = "") return false;


XmlHttp. open ("POST", url, true );


XmlHttp. setRequestHeader ("Content-Type", "application/x-www-form-urlencoded ");


XmlHttp. send (xmvalue );


XmlHttp. onreadystatechange = returnstate;


}


Function returnstate (){


If (xmlHttp. readyState! = 4 ){


Document. getElementById ("pxm"). innerHTML ="

Verifying. please wait...

";


}

If (xmlHttp. readyState = 4 ){


Document. getElementById ("pxm"). innerHTML = xmlHttp. responseText;


}


}

Login to achieve user registration function tutorial 2 ',' // This tutorial by the site original, reproduced please indicate to the author: www.drise.cn mailbox: drise@163.com QQ: 271728967 // above the first reg. php...

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.