Ajax Authentication User name two
<?php
Header ("content-type:text/html;charset=gb2312");
Require_once (' inc/connect.php ');
$XM =isset ($_get[' txt '])? $_get[' txt ']: ' null ';
if (Preg_match ("/^[". Chr (0XA1). " -". Chr (0xFF)."] +$/", $XM)) {
Echo ("<div id= ' error ' > Sorry, can't use Chinese as username!") </div> ");
Exit ();
}
if ($XM = = ' null ' | | $xm = = ' | | strlen ($XM) >10 | | strlen ($XM) <3) {
Echo ("<div id= ' error ' > Sorry, user consists of 3-12aa_zz and numbers!") </div> ");
Exit ();
}else{
$result =mysql_query ("Select M_uid from Wk_member where m_uid= ' $xm") or Die (' Error! '). Mysql_error ());
if (!mysql_num_rows ($result)) {
Echo ("<div id= ' success ' ><font color=red> " Congratulations!) This user can register!</ Font> </div> ");
}else{
Echo ("<div id= ' error ' > Sorry, the user has been registered please choose another name!</div>");
}
}
?>
Original site: www.111cn.net