[php]if ((“email” == $key) || (“paypal” == $key)) {
if (valid_email($value)) {
$value = str_replace("@","",$value);
$value = str_replace(".","",$value);
}
else {
include_once(“header.php”);
error_report(1);
user_signup();
return(1);
}[/php]
my site registration works fine except when trying to register with an email like [email protected] it returns the error every time when the email has a dot in it
The problem is in this your function: valid_email(), you need to check your code there (regular expression, etc.)
[php]function valid_email($email) {
$arr = explode("@",$email);
$arr2 = explode(".", $email);
if ((sizeof($arr) != 2) || (sizeof($arr2) != 2)) {
return(false);
}
if (strpos($arr[0], “.”) === false) {
return(true);
}
return(false);
}[/php]
what would i change here so it would accept an email like [email protected]
thanx i figured it out .i changed the false to true