No.
Code: Select all
function check_email_address($email)
{
if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email))
{
return false;
if ($email ==false)
{
$emailerror = "Email must be filled and valid.<br />";
}
if($email ==true)
{
mail($to,$subject,$message,$headers)
}
1. if you indented properly you would see this would cause a parse error.
2. Once a function hits a return, the function terminates
3. $email will never evaluate to true, because it will only get to that point if it fails the eregi()
4. $to, $subject, $message, $headers are are variables outside the function scope.
Why don't you do it the way I setup in my last post?
Just a note, never ask "will this work" because I will not reply considering you can try it and find out for yourself. My time is precious thanks.
