This form is driving me mad!
Posted: Tue Feb 02, 2010 5:11 am
Hi,
I have a form in php that is working fine in Firefox but not it IE...
It redirects the user to a page once the form is submitted; it does work in Firefox but not in IE.
The data of the form is sent to my email address. When I submitthe form in IE, it shows me the error message instead of redirecting me the right page. However, I do receive the email to my mailbox like it should be.
Here is the code. I hope someone can help me!
PHP CODE
HTML CODE
Thank for any help!
I have a form in php that is working fine in Firefox but not it IE...
It redirects the user to a page once the form is submitted; it does work in Firefox but not in IE.
The data of the form is sent to my email address. When I submitthe form in IE, it shows me the error message instead of redirecting me the right page. However, I do receive the email to my mailbox like it should be.
Here is the code. I hope someone can help me!
PHP CODE
Code: Select all
<?php
$to = $_REQUEST['sendto'] ;
$from = $_REQUEST['Email'] ;
$name = $_REQUEST['Name'] ;
$hidden = $_REQUEST['Hidden'] ;
$headers = "From: $from";
$subject = "Web Contact Data";
$fields = array();
$fields{"Name"} = "Name";
$fields{"Company"} = "Company";
$fields{"Email"} = "Email";
$fields{"Phone"} = "Phone";
$fields{"list"} = "Mailing List";
$fields{"Message"} = "Message";
$body = "We have received the following information:\n\n"; foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); }
$headers2 = "From: myemail@box.net";
$subject2 = "Thank you for contacting us";
$autoreply = "Thank you for contacting us. Here is the link to the brochures. If you encounter an error, please notify it to our website manager by sending an email to that address: email@box.net . '<br />' . Link to brochure page: http://www.page.net/page.html ";
if($from == '') {print "You have not entered an email, please go back and try again";}
else {
if($name == '') {print "You have not entered a name, please go back and try again";}
else {
$send = mail($to, $subject, $body, $headers);
$send2 = mail($from, $subject2, $autoreply, $headers2);
if($send)
{header( "Location: http://www.mysite.net/index.php/page.html" );
exit;
}
else
{print "We encountered an error sending your mail, please notify webmaster@box.net"; }
}
}
?>Code: Select all
<form method="post" action="contact.php">
<table bgcolor=#ebf6c6 align=center ">
<tr><td> <input type="hidden" size=25 name="sendto" value="email@box.net"></td></tr>
<tr>
<b> Download our brochures <small> (full details of our services & products) </small> </b>
<td><font color=red>*</font> Name:</td><td><input size=15 name="Name"></td>
<td><font color=red>*</font> Email:</td><td><input size=15 name="Email"></td>
<td colspan=2 align=center><input type=submit name="send" value="Submit"></td>
</tr>
</table>
<div align=center> <small> A link will be send to your mail box to download the brochures in a PDF format.</small> </div>
</form>