/[LeafOK_CVS]/fenglin/bbs/ch_username_sub.php
ViewVC logotype

Diff of /fenglin/bbs/ch_username_sub.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.4 by sysadm, Thu Jan 7 01:21:28 2010 UTC Revision 1.6 by sysadm, Sat Mar 1 08:43:28 2025 UTC
# Line 13  if ($_SESSION["BBS_uid"]==0) Line 13  if ($_SESSION["BBS_uid"]==0)
13  $permit = false;  $permit = false;
14  if (preg_match("/^[A-Za-z]{3,12}$/",$_SESSION["BBS_username"]))  if (preg_match("/^[A-Za-z]{3,12}$/",$_SESSION["BBS_username"]))
15  {  {
16          error_msg ("您无权修改用户名!", true);          error_msg ("鎮ㄦ棤鏉冧慨鏀圭敤鎴峰悕锛", true);
17          exit();          exit();
18  }  }
19    
20  $username=htmlspecialchars(trim($_POST["username"]));  $username=htmlspecialchars(trim($_POST["username"]), ENT_COMPAT | ENT_HTML401, 'UTF-8');
21  $username=addslashes($username);  $username=addslashes($username);
22    
23  if (!preg_match("/^[A-Za-z]{5,12}$/",$username))  if (!preg_match("/^[A-Za-z]{5,12}$/",$username))
24  {  {
25          error_msg ("用户名填写不正确!", true);          error_msg ("鐢ㄦ埛鍚嶅~鍐欎笉姝g‘锛", true);
26          exit();          exit();
27  }        }      
28  if (!check_str($username))  if (!check_str($username))
29  {  {
30          error_msg ("用户名含有系统保留词!", true);          error_msg ("鐢ㄦ埛鍚嶅惈鏈夌郴缁熶繚鐣欒瘝锛", true);
31          exit();          exit();
32  }  }
33    
# Line 36  $db_conn=include "./db_open.inc.php"; Line 36  $db_conn=include "./db_open.inc.php";
36  $rs=mysql_query("select UID from user_list where username='$username' limit 1");  $rs=mysql_query("select UID from user_list where username='$username' limit 1");
37  if (mysql_num_rows($rs)>0)  if (mysql_num_rows($rs)>0)
38  {  {
39          error_msg ("用户名已存在!", true);          error_msg ("鐢ㄦ埛鍚嶅凡瀛樺湪锛", true);
40          exit();          exit();
41  }  }
42  mysql_free_result($rs);  mysql_free_result($rs);


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1