Ajax User Logon

Source: Internet
Author: User

 

Ajax User Logon function Ajax User Logon Ajax user registration Ajax login Ajax detection user name Ajax check user name Ajax function Ajax User Name authentication ASP Ajax User Name authentication Ajax function Ajax ASP login/

Let's talk about the effect of static file login through Ajax today. First, let's take the website login:

This seems to be no different from anything else, but let's take a closer look at it as a static page portal. The effect of successful login on this static page is,This is the column selected for login,

 

What we want is to look at this. This is the effect of successfully logging on to index.html. However, I want to declare that it is not implemented by the framework, but exactly implemented by Ajax, next let's take a look at its HTML source code. We will issue the code at the end of the file:

<Script language = "JavaScript">
<! --
Function return_member (STR ){
VaR url = '';
Ajaxcreate ();
If (STR = 0 ){
Url = "/member. php? Action = "+ math. Random ();
} Else {
Url = "/user_login.php? Pp = "+ math. Random ();
}
XMLHTTP. Open ("get", URL, true );
XMLHTTP. Send (null );
If (STR = 0 ){
XMLHTTP. onreadystatechange = returnstate;
} Else {
XMLHTTP. onreadystatechange = update_login;
}
}
 
Function returnstate (){
If (XMLHTTP. readystate! = 4 ){
Document. getelementbyid ("ajax"). innerhtml = "loading data. Please wait ...";
}
If (XMLHTTP. readystate = 4 ){
Document. getelementbyid ("ajax"). innerhtml = XMLHTTP. responsetext;
}
}
Function update_login (){
If (XMLHTTP. readystate = 4 ){
Document. getelementbyid ("pper"). innerhtml = XMLHTTP. responsetext;
}
}
Function loader (){
Return_member ();
}
-->
</SCRIPT>

This code url = "/user_login.php? Pp = "+ math. Random (); this is to send the data to the user_login.php file for processing. In fact, the PHP file is no different from the common login method.

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.