PDA

View Full Version : my contact form wont work in IE but works fine in Firefox



m1nd
12 Oct 2010, 06:36 PM
For some reason my contact form wont work in IE but works perfectly in firefox.. :mad:

here is my html code:


<form method="post" action="contact.php">
<input size=15 name="First_Name">
<input size=15 name="Last_Name">
<input size=15 name="Email">
<input size=15 name="Order_Number">
<select "name="sendto">
<option value="support@maingear.com">Support</option>
<option value="sales@maingear.com">Sales</option>
<option value="wendel@maingear.com">General</option>
</select>
<input size=15 name="Phone">
<input size=56 name="title">
<textarea name="Message" rows=15 cols=42></textarea>
<input type="submit" value="Submit" name="submit" />
</form>

here is my php code:


<?php
$to = $_REQUEST['sendto'] ;
$from = $_REQUEST['Email'] ;
$title = $_REQUEST['title'] ;
$first_name = $_REQUEST['First_Name'] ;
$headers = "From: $from";
$subject = "Contact Form: $title";
$fields = array();
$fields{"First_Name"} = "First Name";
$fields{"Last_Name"} = "Last Name";
$fields{"Order_Number"} = "Order Number";
$fields{"Email"} = "Email";
$fields{"Phone"} = "Phone";
$fields{"Message"} = "Message";
$body = "Website Contact Form\n\n";
foreach($fields as $a => $b){ $body .= sprintf("%s: %s\n",$b,$_REQUEST[$a]);
} $headers2 = "From: noreply@mysite.com";
$subject2 = "Thank you for contacting us.";
$autoreply = "Thank you for contacting us. A representative will respond to you as soon as possible, usualy within 48 hours. If you have any more questions, please call us at 1-555-55555.";
if($send) {print "You have not entered an email, please go back and try again";} else { if($send) {print "You have not entered a First 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.com/thankyou.html" );
} else {print "We encountered an error sending your mail, please notify webmaster@YourCompany.com"; } } }
?>


i appreciate any help i can get.

thanks

m1nd
12 Oct 2010, 07:21 PM
Looks like i had a syntax error


<select "name="sendto">

should be


<select name="sendto">