View Full Version : PHP Contact forms working in FF, not in IE

11-20-2006, 05:35 AM
Hey all.

Having a weird issue with IE6/7. My forms are working in Firefox, but not at all in IE. The code is below. Any insight would be much appreciated.

$to = "jemail@email.com";
$sub = "From JustinandMelis.com - Contact Page";
$headers = "From: $name <$email>\n";
$headers .= "Content-Type: text/plain; charset=iso-8859-1\n";
$name = $_POST["name"];
$email = $_POST["email"];
$msg = $_POST["message"];
$message = stripslashes($msg);
$mes .= "Message: ".$message."\n";
$mes .= "Name: ".$name."\n";
$mes .= 'Email: '.$email."\n";
if (!isset($_POST['submit'])) { // if page is not submitted to itself echo the form
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<title>Contact Us - Melissa &amp; Justin - 07.28.07</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="robots" content="none" />
<script src="js/si_behaviors.js" type="text/javascript" language="javascript"></script>
<script src="js/si_onload.js" type="text/javascript" language="javascript"></script>
<link rel="stylesheet" type="text/css" media="screen" href="css/base.css"/>
<script type="text/javascript">
function checkform ( form )
// see http://www.thesitewizard.com/archive/validation.shtml
// for an explanation of this script and how to use it on your
// own website

// ** START **
if (form.name.value == "") {
alert( "Please enter your name." );
return false ;

if (form.email.value == "") {
alert( "Please enter your email address. If you have none, please enter your phone number, or 'None'" );
return false ;

if (form.message.value == "") {
alert( "Please enter a message." );
return false ;
// ** END **
return true ;

<div id="logo"><a title="Liz and Jason - 10.14.05" href="/"><img src="img/nameplate.gif" alt="Liz and Jason - 10.14.05" /></a></div>
<div id="wrap-mast">
<div id="nav">
<ul id="menu">
<li id="weddingmenu"><a title="Wedding Day" href="/">WEDDING DAY</a></li>
<li id="directionsmenu"><a title="Directions" href="directions.php">DIRECTIONS</a></li>
<li id="lodgingmenu"><a title="Lodging" href="lodging.php">LODGING</a></li>
<li id="registrymenu"><a title="Registry" href="registry.php">REGISTRY</a></li>
<li id="rsvpmenu"><a title="Rsvp" href="rsvp.php">RSVP</a></li>
</ul> </div><!-- close nav -->
</div><!-- close wrap-mast -->

<div id="wrap-header">
<h2><img src="img/head_contact.gif" width="300" height="33" alt="Contact Us" /></h2>
<img src="img/bumper.gif" width="240" height="8" alt="" />

<div id="wrap-main">

<div id="content">
<div id="pricol">
<p>If you have any questions about the big day, please feel free email us below:</p>
<form action="<?php echo $PHP_SELF;?>" method="post" id="contactForm" onsubmit="return checkform(this);">
<label for="realname">Your Name</label><input id="realname" name="name" class="text" tabindex="1" /><br />
<label for="emailadd">Email Address</label><input id="emailadd" name="email" class="text" tabindex="2" /><br />
<label for="message">Message</label><textarea rows="8" cols="50" name="message" id="message" tabindex="3"></textarea>
<input type="image" src="/img/submit_btn.gif" alt="Submit" name="submit" value="submit" class="imgbtn" tabindex="4" />
} else {
mail($to, $sub, $mes, $headers);
print "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN'
<html xmlns='http://www.w3.org/1999/xhtml' lang='en' xml:lang='en'>
<title>Contact Us - Melissa &amp; Justin - 07.28.07</title>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<meta name='robots' content='none' />
<script src='js/si_behaviors.js' type='text/javascript' language='javascript'></script>
<script src='js/si_onload.js' type='text/javascript' language='javascript'></script>
<link rel='stylesheet' type='text/css' media='screen' href='css/base.css'/>


<div id='logo'><a title='Liz and Jason - 10.14.05' href='/'><img src='img/nameplate.gif' alt='Liz and Jason - 10.14.05' /></a></div>
<div id='wrap-mast'>
<div id='nav'>
<ul id='menu'>
<li id='weddingmenu'><a title='Wedding Day' href='/'>WEDDING DAY</a></li>
<li id='directionsmenu'><a title='Directions' href='directions.php'>DIRECTIONS</a></li>
<li id='lodgingmenu'><a title='Lodging' href='lodging.php'>LODGING</a></li>
<li id='registrymenu'><a title='Registry' href='registry.php'>REGISTRY</a></li>
<li id='rsvpmenu'><a title='Rsvp' href='rsvp.php'>RSVP</a></li>
</ul> </div><!-- close nav -->
</div><!-- close wrap-mast -->

<div id='wrap-header'>
<h2><img src='img/head_contact.gif' width='300' height='33' alt='Contact Us' /></h2>
<img src='img/bumper.gif' width='240' height='8' alt='' />

<div id='wrap-main'>

<div id='content'>
<div id='pricol'> <p class='rsvpby'>Thank you, ".$name.", for contacting us.<br>We will get back to you as soon as possible.</p>";

</div><!-- close pricol -->

<hr class="hide" />

<div id="seccol">
<div class="subitem first">
<h3>Engagement Photographs</h3>
<div class="thumb"><a title="Wedding Photographs" href="/photos"><img src="img/home_photos.jpg" alt="Wedding Photographs" /></a></div>
<p>What a fun day! <a title="Wedding Photographs" href="/photos">Here are the photos &#187;</a></p>

<div class="subitem">
<p>Have a song you're dying to shake your booty to at the reception? <a title="Request-a-Song" href="request-a-song.php">Let us know &raquo;</a></p>


<div class="subitem">
<h3>Have a question?</h3>
<p>If you have any questions or concerns, feel free to <a title="Contact us" href="contact.php">contact us &raquo;</a></p>

</div><!-- close seccol -->
</div><!-- close content -->
</div><!-- close wrap-main -->

<div id="wrap-footer">
<div id="footer">

<img src="img/bumper.gif" width="240" height="8" alt="" />
</div><!-- close wrap-footer -->

11-20-2006, 07:18 AM
nm, got it figured out.