Ajax Authentication User name three

Source: Internet
Author: User
Tags chr

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>&nbsp;&nbsp;&nbsp;&nbsp;" 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

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.