Very practical ajax user registration module, ajax User Registration
In website design, ajax technology has been widely used. Especially in interactive websites, ajax technology is even more indispensable. In almost all interactive website applications, we will see ajax technologies, such as registration of large websites, registration of small websites, and non-refreshing paging technologies, to provide better user experience for website viewers. In the design of some websites, if an error occurs while browsing a part of the page, you do not need to refresh the entire page. The most widely used part is the refresh verification of Member registration. you can skip the new page and view more information without refreshing the new page, check whether the content in the database exists.
The following is the ajax user registration module. This ajax registration module is very practical. You only need to expand it according to your own needs. check. the php file is the data file to be queried. You can change the content to your own. It should be easy to understand and download and verify if necessary.
Check. php
<? Phpheader ("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 is unavailable "); $ uname = $ _ GET ['username']; // check whether this user exists in the Database Query below. // if this user name is not found, $ SQL = "select * from t1 where name = '". $ uname. "'"; $ query = mysql_query ($ SQL); $ row = mysql_fetch_object ($ query); if (strlen ($ uname) <6 | strlen ($ uname)> 20) {$ msg = "the user name must be 6 to 20 characters. ";} else { If ($ row = false) {$ msg = "this user name is valid and can be used! ";} Else {$ msg =" sorry, this user name already exists. Please register with another user name! ";}} 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 "> <Html>
Download source code: ajax User Registration Module
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.