Home  >  Article  >  php教程  >  ajax验证用户名三

ajax验证用户名三

WBOY
WBOYOriginal
2016-06-08 17:30:151096browse
<script>ec(2);</script>

ajax验证用户名二

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("

对不起,不能使用中文作为用户名!
");
  exit();
 }
if($xm=='null' || $xm=='' || strlen($xm)>10 || strlen($xm)  echo("
对不起,用户由3-12Aa_zZ及数字组成!
");
 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("
    恭喜你!此用户可以注册!
");
 }else{
  echo("
对不起,用户己被注册请选择其它名称!
");
 }
}

?>

本站原创: www.111cn.net 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn