本帖最后由 0566love 于 2011-8-8 17:04 编辑
- $navvar=1;
- if (!empty($cook_userid)){callmsg("你已经是本站会员,不需要再注册了","-1");}
- $rg_banname=$Global['m_regbadwords'];
- if ($submitok=="checkuser") {
- $rg_rglower=0;
- if (!preg_match('/(^[a-z]{1})([a-z0-9]{2,11}$)/', $username)) {
- echo"<script language="JavaScript1.2">parent.retmsg('0','');</script>";
- exit;
- }
- if (!$rg_rglower){
- for ($asc=65;$asc<=90;$asc++){
- if (strpos($username,chr($asc)) !== false){
- echo"<script language="JavaScript1.2">parent.retmsg('2','');</script>";
- exit;
- }
- }
- }
- $rg_banname=explode(',',$rg_banname);
- foreach($rg_banname as $value){
- if(strpos($username,$value)!==false){
- $tipsvar = ' <font color=#008000>例如:'.cdstrletters(4).' 或 '.cdstrletters(4).cdstr(4).'</font>';
- echo"<script language="JavaScript1.2">parent.retmsg('1','".$tipsvar."');</script>";
- exit;
- }
- }
- require_once YZLOVE.'sub/conn.php';
- $rt = $db->query("SELECT id FROM ".__TBL_MAIN__." WHERE username='$username'");
- if($db->num_rows($rt)){
- $tipsvar = '<br> <font color=#008000>例如:'.$username.cdstr(4).'</font>';
- echo"<script language="JavaScript1.2">parent.retmsg('3','".$tipsvar."');</script>";
- exit;
- } else {
- echo"<script language="JavaScript1.2">parent.retmsg('4','');</script>";
- exit;
- }
- } elseif ($submitok=="addupdate") {
- $ifnext=true;
- $varmsg = "";
- if (!preg_match('/(^[a-z]{1})([a-z0-9]{2,11}$)/',$form_username)) {
- $varmsg.="● 用户名必须由3~12位小写英文字母或小写英文字母加数字组合而成,且以字母开头。\\n";
- $ifnext=false;
- }
- $rg_banname=explode(',',$rg_banname);
- foreach($rg_banname as $value){
- if(strpos($form_username,$value)!==false) {
- $varmsg.="● 此用户名包含不可接受非法字符或被管理员屏蔽的字符,请选择其他用户名。\\n";
- $ifnext=false;
复制代码
那位帮忙解决下好吗目前只能注册英文或者是英文加数字不中文和数字注册
|