[Original]ajax Realization user Registration Function Tutorial Three _php tutorial

Source: Internet
Author: User
[Original]ajax Realization user Registration function Tutorial Three

This tutorial by the original site, reproduced please specify to place

Author: www.drise.cn

E-mail: drise@163.com



Now to the third step, we will write the type.php file, the role of this file is to determine whether the user name exists, and then the data to the user.

Header ("content-type:text/html;charset=gb2312");//In order to keep it garbled, set the document encoding to GB2312
$XM =strreplace (isset ($_get[' txt])? $_get[' txt ']: ' null ');//Get User name
if (Preg_match ("/^[". Chr (0XA1). " -". Chr (0xff)." +$/", $XM)) {//Determine if the first user name is a Chinese character,
Echo ("Sorry, can't use Chinese as user name!");
Exit ();
if ($XM = = ' null ' | | $xm = = ' | | strlen ($XM) >10 | | strlen ($XM) <3) {//To determine the legality of the user name
Echo ("Sorry, the user name you entered is not legal, the user is composed of 3-10aa_zz and numbers!");
Exit ();
$result =mysql_query ("Select uname from tablename where uname= ' $xm '") or Die (' Error! ') Error system Busy.....plase wait! ");
if (!mysql_num_rows ($result)) {
Echo ("Congratulations! User name". $xm. " Not yet registered, you can register! ");
Echo ("Sorry, the user has already registered please choose another name!");

http://www.bkjia.com/PHPjc/629574.html www.bkjia.com true http://www.bkjia.com/PHPjc/629574.html techarticle //[Original]ajax Implement user Registration function tutorial Three this tutorial by the original site, reproduced please specify the author: www.drise.cn e-mail: drise@163.com qq:271728967//Now to the third step, we come ...

  • 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.