[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
qq:271728967
//
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 ();
}else{
$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! ");
}else{
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 ...