[Original]ajax Implement user Registration function tutorial Two _php tutorial

Source: Internet
Author: User
[Original]ajax Realization User Registration Function Tutorial two ', '

//

This tutorial by the original site, reproduced please specify to place

Author: www.drise.cn

E-mail: drise@163.com

qq:271728967

//

The first reg.php file above has been done, and I'll take the second step.

var xmlHttp = false;
function Ajaxcreate () {//Here is the creation of XMLHTTPT on the image

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 () {//Here is the action to take after receiving the reg.php onblur () event,

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 ("Divxm"). Innerhtml= "In validation, please later ...";


}

if (xmlhttp.readystate = = 4) {


document.getElementById ("Divxm"). Innerhtml=xmlhttp.responsetext;


}


}

http://www.bkjia.com/PHPjc/629575.html www.bkjia.com true http://www.bkjia.com/PHPjc/629575.html techarticle [Original]ajax realize user Registration function tutorial Two ', '///This tutorial by the original site, reproduced please indicate the author: www.drise.cn e-mail: drise@163.com qq:271728967//above the first reg.php text ...

  • Related Article

    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.