我正在尝试添加一个步骤,如果输入的密码包含输入的用户名,那么它会返回错误,即 pass cannot contain username。我说的是“包含”,而不是密码。在那种情况下,我可以简单地做elseif($password == "$user_username") $error .= $lang['46'];}
$user_username = cleanit($_REQUEST['username']);
STemplate::assign('user_username',$user_username);
$password = cleanit($_REQUEST['password']);
STemplate::assign('password',$password);
if($user_username == "")
{
$error .= $lang['41']; //Error: Please enter your username
}
elseif(strlen($user_username) < 4) //Your username should have 4 chars
{
$error .= $lang['42'];
}
elseif(!preg_match("/^[a-zA-Z0-9]*$/i",$user_username)) //name only contains letters and numbers
{
$error .= $lang['43'];
}
elseif(!verify_email_username($user_username)) //username already taken
{
$error .= $lang['44'];
}
elseif($password == "") //no password entered
{
$error .= $lang['45'];
}