Home > php教程 > PHP源码 > body text

ajax验证用户名三

WBOY
Release: 2016-06-08 17:30:15
Original
1098 people have browsed it
<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 

Related labels:
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!