Very practical ajax user registration module, ajax User Registration

Source: Internet
Author: User

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.

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.