if other length login error small-login if other length login 10 error

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
if (other::length($login) < 4) $error[] = 'small-login';
if (other::length($login) > 10) $error[] = 'big-login';
if (other::length($password) < 8) $error[] = 'small-password';
if (other::length($password) > 32) $error[] = 'big-password';
if (other::length($name) < 2) $error[] = 'small-name';
if (other::length($name) > 32) $error[] = 'big-name';
if (!preg_match("@^([a-zа-я0-9\-]+)$@sui", $login)) $error[] = 'wrong-login';
if (preg_match("@^([0-9]+)$@sui", $login[0])) $error[] = 'wrong-login';
if (preg_match("@([\-]{2,20})@sui", $login)) $error[] = 'wrong-login';
if (preg_match("@([а-я]+)@sui", $login) && preg_match("@([a-z]+)@sui", $login)) $error[] = 'wrong-login';
if (!preg_match("@^([a-z0-9\.\-\_]{1,20})@([a-z0-9\-]{1,20})\.([a-z]{1,20})$@sui", $email)) $error[] = 'wrong-email';
if ($_SESSION['captcha'] != $captcha) $error[] = 'wrong-captcha';