Very useful Ajax User Registration module _ajax related

Source: Internet
Author: User

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.

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.