After a new user has filled in a form to register for my site, I check that she has entered the same password twice by calling a homemade function. Like this:
$u_pwd = validate_password($_POST['u_pwd'],$_POST['u_pwd1']);
And the function looks like this:
function validate_password($unchecked_password1, $unchecked_password2, $errortype = 1, $errormessage = "Password must contain just letters and figures.") {
if(!($unchecked_password1 == $unchecked_password2)) {
error("Passwords entered doesn't match!");
}
if(!ereg("(^[a-zA-ZåÅäÄöÖ0-9]{6,15}$)", $unchecked_password2)) { if($errortype == 1) { error($errormessage); } Return 1; } }
I have verified that $_POST['u_pwd'] and $_POST['u_pwd1'] as well as $unchecked_password1 and $unchecked_password2 contains the entered values, but $u_pwd is empty.
Why?
As with my previous problems this evening, it works on my local server, but not on my ISP's. At home I'm running Windows 2000 and PHP 4.3.1, while my ISP is on SunOS 5.7 with PHP 4.1.1.
-- anders thoresson
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php