One more in my recent woes. The last elseif does not work in the code below
- even if the string is correct it always says it's incorrect. Even if I
remove everything else and just have the ereg satement is doesn't work
either.
The code below is in a function and $_POST['password1'] is passed to the
function.
$field = "password1"; //Use field name for password
if(!$subpass){
$form->setError($field, " Password not entered");
}
elseif(strlen($subpass) < 6) {
$form->setError($field, " Too Short");
}
elseif(strlen($subpass) > 10) {
$form->setError($field, " Too Long");
}
elseif(!ereg('[^A-Za-z0-9]', trim($subpass))) {
$form->setError($field, " Not alphanumeric");
}
Thanks
B
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php