(Added php bbcode tags around code and hid email address -- MOD)
Below is the code that I have been using for my contact form. It keeps sending blank emails. Any help would be great!
Thanks!
<?php
/* Subject and Email Variables */
$emailSubject = 'More Information';
$webMaster = '*******@gmail.com';
/* Gathering Data Variables */
$nameField = $_POST['name'];
$emailField = $_POST['email'];
$commentsField = $_POST['comments'];
$body = <<<EOD
<br><hr><br>
Name: $nameField <br>
Email: $emailField <br>
Phone Number: $commentsField <br>
EOD;
$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body, $headers);
$theResults = <<<EOD
<html><!-- InstanceBegin template="/Templates/sock_moneky_index.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Sock Monkey Improv</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- InstanceBeginEditable name="head" -->
<style type="text/css">
<!--
a img {
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
}
-->
</style>
<!-- InstanceEndEditable -->
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- ImageReady Slices (sock_moneky_index.ai) -->
<table width="865" height="696" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
<tr>
<td colspan="8">
<img src="images/sock_moneky_index_01.jpg" width="864" height="30" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="30" alt=""></td>
</tr>
<tr>
<td colspan="4" rowspan="2">
<img src="images/sock_moneky_index_02.jpg" width="407" height="49" alt=""></td>
<td align="left" valign="top"><!-- InstanceBeginEditable name="EditRegion2" --><a href="about.html"><img src="images/sock_moneky_index_03.jpg" width="97" height="37" alt=""></a><!-- InstanceEndEditable --></td>
<td colspan="3" rowspan="2">
<img src="images/sock_moneky_index_04.jpg" width="360" height="49" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="37" alt=""></td>
</tr>
<tr>
<td>
<img src="images/sock_moneky_index_05.jpg" width="97" height="12" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="12" alt=""></td>
</tr>
<tr>
<td colspan="3" rowspan="2">
<img src="images/sock_moneky_index_06.jpg" width="163" height="75" alt=""></td>
<td colspan="3" rowspan="5" align="left" valign="top"><!-- InstanceBeginEditable name="EditRegion4" --><img src="images/sock_moneky_index_07.jpg" width="534" height="392" alt=""><!-- InstanceEndEditable --></td>
<td colspan="2">
<img src="images/sock_moneky_index_08.jpg" width="167" height="67" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="67" alt=""></td>
</tr>
<tr>
<td rowspan="2" align="left" valign="top"><!-- InstanceBeginEditable name="EditRegion3" --><a href="contact.html"><img src="images/sock_moneky_index_09.jpg" width="113" height="40" alt=""></a><!-- InstanceEndEditable --></td>
<td rowspan="5">
<img src="images/sock_moneky_index_10.jpg" width="54" height="549" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="8" alt=""></td>
</tr>
<tr>
<td rowspan="4">
<img src="images/sock_moneky_index_11.jpg" width="57" height="541" alt=""></td>
<td rowspan="2" align="left" valign="top"><!-- InstanceBeginEditable name="EditRegion1" --><a href="events.html"><img src="images/sock_moneky_index_12.jpg" width="104" height="40" alt=""></a><!-- InstanceEndEditable --></td>
<td rowspan="4">
<img src="images/sock_moneky_index_13.jpg" width="2" height="541" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="32" alt=""></td>
</tr>
<tr>
<td rowspan="3">
<img src="images/sock_moneky_index_14.jpg" width="113" height="509" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="8" alt=""></td>
</tr>
<tr>
<td rowspan="2">
<img src="images/sock_moneky_index_15.jpg" width="104" height="501" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="277" alt=""></td>
</tr>
<tr>
<td colspan="3">
<img src="images/sock_moneky_index_16.jpg" width="534" height="224" alt=""></td>
<td>
<img src="images/spacer.gif" width="1" height="224" alt=""></td>
</tr>
<tr>
<td>
<img src="images/spacer.gif" width="57" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="104" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="2" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="244" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="97" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="193" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="113" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="54" height="1" alt=""></td>
<td></td>
</tr>
</table>
<!-- End ImageReady Slices -->
</body>
<!-- InstanceEnd --></html>
EOD;
echo "$theResults";
?>