Hi everyone,
I’m having a problem that is pulling my hair out. I have made a contact form that works perfect in Firefox, it sends the email and directs the user to the thankyou page which is “contactthanks.html”, but it will not do either in IE. It won’t even send the mail and it just comes up “blarg!”.
Can anyone help me? I’ve looked at so many tutorials to find out what the problem is but can’t seem to sort it out… I’m not a PHP expert but I’m thinking there’s probably something minor that IE doesn’t like and I just cant figure it out, any ideas? Here’s my code:
HTML
<form method="POST" action="mailer.php" class="cssform3">
<p><label>Your Name:</label><input type="text" name="name" /></p>
<p><label>Your Email:</label><input type="text" name="email" /></p>
<p><label>Your Message:</label><textarea name="message"></textarea></p>
<input type="image" value="Submit" name="submit" class="submitbtn" src="images/submit.gif" >
</form>
PHP
<?php
if(isset($_POST['submit'])) {
$to = "myemail@gmail.com";
$subject = "Contact Form";
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$message = $_POST['message'];
$body = "From: $name_field
E-Mail: $email_field
Message:
$message";
mail($to, $subject, $body);
Header("Location: contactthanks.html");
} else {
echo "blarg!";
}
?>
Thanks in advance for any help or ideas on whats up with this! As I said, FF is fine, just IE seems to not like it… Thanks!