Good Afternoon,
I have created a few forms on my site that the user will fill in and when it is submitted a php page processes the data, including E-mail validation, and sends me a mail to the chosen address.
I have tested it in IE8 and Safari, it works fine. When I try the form using Firefox, I get the Undefined Function: Getmxrr() error.
Here is the code I use
function checkEmail($email)
{
if(eregi("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$]", $email))
{
return FALSE;
}
list($Username, $Domain) = split("@",$email);
if(getmxrr($Domain, $MXHost))
{
return TRUE;
}
else
{
if(fsockopen($Domain, 25, $errno, $errstr, 30))
{
return TRUE;
}
else
{
return FALSE;
}
}
}
if(checkEmail($email) == FALSE)
{
header( "Location: $errorurl" );
exit ;
}
else
{
Code then processes the rest of form as long as E-mail is valid
I dont think it is a fault with the coding, but any advice would be welcome.
Regards,
Phil