Hi All,
I have a form that submits using my send.php page but talks back to the page with jquery and ajax so everything is inline.
My issue is that I edited the php page to account for some additional fields. It works fine in Firefox and Safari (doing it all inline using ajax)... but not in IE 8. If I take out the portion I edited it all works fine under IE. The form still sends the email under IE but what it does is goes to another page and prints 1,2 or 3 instead of using the ajax and giving the response inline.
Here is the php
<?php
error_reporting(E_NOTICE);
function valid_email($str)
{
return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str)) ? FALSE : TRUE;
}
if($_POST['name']!='' && $_POST['email']!='' && valid_email($_POST['email'])==TRUE && strlen($_POST['comment'])>1)
{
$to = "support@emailaddress.com";
$headers = 'From: '.$_POST['email'].''. "\r\n" .
'Reply-To: '.$_POST['email'].'' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
$subject = htmlspecialchars($_POST['topic']);
$message = htmlspecialchars($_POST['version']);
$message .= "\n" . htmlspecialchars($_POST['comment']);
if(mail($to, $subject, $message, $headers))
{
echo 1; //SUCCESS
}
else {
echo 2; //FAILURE - server failure
}
}
else {
echo 3; //FAILURE - not valid email
}
?>
This is the portion I added in so that it append to the message section of the email sent
$message .= "\n" . htmlspecialchars($_POST['comment']);
any help on tweaking so it might work in IE8 would be great. The page can be seen at www.reaxtive.com