In web design, the use of Ajax technology is already very common, especially in the interactive web site, Ajax technology is even more indispensable, almost all interactive Web applications, will see Ajax technology, large sites such as membership registration, small sites such as no refresh paging technology, A better user experience for Web surfers, in the local web design, if browsing a certain part of the error, and do not need to refresh the entire Web page, the most widely used part is the member registration of no refresh verification, no refresh of the paging, no refresh view more, no refreshing query the content of the database exists and so on.
The following is the AJAX User Registration module, this AJAX registration module is very practical, everyone as long as according to their own needs in the expansion can be, check.php this file is a query of the data file, the contents of the query to change their own can be, it should be easy to understand, there is a need for download verification.
check.php
<?php
Header ("content-type:text/html;charset=gb2312");
@mysql_connect (' localhost ', ' root ', ' Ebaeba ') or Die ("Database server Connection Failed");
@mysql_select_db ("test") or Die ("database does not exist or not available");
$uname = $_get[' UserName '];
The following database query to find if there is a user
//If not found this user name
$sql = "SELECT * from t1 where name= '". $uname. "'";
$query =mysql_query ($sql);
$row =mysql_fetch_object ($query);
if (strlen ($uname) <6| | Strlen ($uname) >20)
{
$msg = "Username must be 6 to 20 characters.";
}
else
{
if ($row ==false)
{
$msg = "The username is valid and can be used!" ";
}
else
{
$msg = "Sorry, this username already exists, please change user name registration!";
}
}
echo $msg;
? >
reg.php
<% @page language= "java" contenttype= "text/html;charset=gb2312"%> <! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.0//en" "HTTP://WWW.W3.ORG/TR/REC-HTML140/STRICT.DTD" >
SOURCE Download: Ajax User Registration Module
The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.