I have the following PHP code for form processing :
$post = cleanpost($_POST, $db->link);
echo strlen($post['login']).' -- '.strlen($post['pass']); // for debug
if ((strlen($post['login']) < 3) || (strlen($post['pass'] < 7)))
{
$page = new Page("subscribe");
$page->assign("msg", "At least 3 characters for the login and 7 characters for the password");
}
The form successfully filters the stated cases (less then 3 chars for the login and less than 7 chars for the password) but sometimes I get filtered when I should pass : I tried to register with "asdf" // "asdfasdf" and I still get the message. As you can see, I have echoed my strlens, they say 4 and 8. I'm totally stuck here
if ((strlen($post['login']) < 3) || (strlen($post['pass'] < 7)))
应该:
if ((strlen($post['login']) < 3) || (strlen($post['pass']) < 7))
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.