This is my first shot at creating a form which processes using php. I used an online tutorial from tutvid.com
Everything works - except for the most important part - when my client receives the email generated by my php script, it comes across with all of the info missing, like this:
Bride Email:
Name:
Bride Phone Number:
Date:
Groom Name:
Groom Email:
Groom Phone:
(where it should have the actual information after the ":" ) I've verified that my form fields are named correctly, etc.
I don't know where to go from here. I've re-written the code 3 times, and have been searching for an answer for days... Any help would be greatly appreciated.
I hate feeling like a novice 🙂 but I AM! lol
Here is my code:
<?php
/* Subject and Email Variables */
$emailSubject = 'New Client Info';
$webMaster = 'example@example.com';
/* Gathering data variables */
$bname = $_POST ['bname'];
$bemail = $_POST ['bemail'];
$bphone = $_POST ['bphone'];
$date = $_POST ['date'];
$gname = $_POST ['gname'];
$gemail = $_POST ['gemail'];
$gphone = $_POST ['gphone'];
$body = <<<EOD
<br><hr><br>
Bride Email: $bemail <br>
Name: $bname <br>
Bride Phone Number: $bphone <br>
Date: $date <br>
Groom Name: $gname <br>
Groom Email: $gemail <br>
Groom Phone: $gphone <br>
EOD;
$headers = "From: $bemail\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body, $headers);
/*results rendered as html */
$theResults = <<<EOD
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Nashville-Weddings</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
<!--
body,td,th {
font-family: Georgia, Times New Roman, Times, serif;
font-size: 14px;
color: #FFFFFF;
}
body {
background-color: #000000;
background-image: url(../Couple.png);
background-repeat: no-repeat;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.style1 {color: #FFFFFF}
a:link {
color: #FFFFFF;
}
a:visited {
color: #FFFFCC;
}
a:hover {
color: #FFFFCC;
}
.style3 {
color: #000000;
font-weight: bold;
font-size: 16;
}
-->
</style></head>
<body>
<!-- ImageReady Slices (Nashville-Weddings.psd) -->
<table id="Table_01" width="1280" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="288" height="0" nowrap="nowrap"></td>
<td width="112" height="0" nowrap="nowrap"></td>
<td width="248" height="0" nowrap="nowrap"></td>
<td width="138" height="0" nowrap="nowrap"></td>
<td width="96" height="0" nowrap="nowrap"></td>
<td width="127" height="0" nowrap="nowrap"></td>
<td width="271" height="0" nowrap="nowrap"></td>
<td width="0" height="0"></td>
</tr>
<tr>
<td width="288" height="142"> </td>
<td width="112" height="142"> </td>
<td width="248" height="142"> </td>
<td width="138" height="142"> </td>
<td width="96" height="142"> </td>
<td width="127" height="142"> </td>
<td width="271" height="142"> </td>
<td width="0" height="142" nowrap="nowrap"></td>
</tr>
<tr>
<td width="288" height="38"> </td>
<td width="112" height="38" bgcolor="#000000"><div align="center" class="style1"><a href="../index.html">HOME</a></div></td>
<td width="248" height="38" background="meet.html" bgcolor="#000000"><div align="center" class="style1"><a href="meet.html">MEET BILL COVINGTON</a></div></td>
<td width="138" height="38" background="services.html" bgcolor="#000000"><div align="center" class="style1"><a href="services.html" class="style1">SERVICES</a></div></td>
<td width="96" height="38" bgcolor="#000000"><div align="center"><span class="style1"><a href="faq.html">FAQ</a></span></div></td>
<td width="127" height="38" background="contact.html" bgcolor="#000000"><div align="center"><span class="style1"><a href="contact.html">CONTACT</a></span></div></td>
<td width="271" height="38"> </td>
<td width="0" height="38" nowrap="nowrap"></td>
</tr>
<tr>
<td width="288" height="828"> </td>
<td width="112" height="828"> </td>
<td width="609" height="828" colspan="4" align="left" valign="top" background="../images/Nashville-Weddings_17.gif"><blockquote>
<pre> </pre>
<p> </p>
<p align="center" class="style3">Thank you.</p>
<p align="center" class="style3">Your information has been received.</p>
<p align="center" class="style3">We will contact you shortly. </p>
</blockquote></td>
<td width="271" height="828"> </td>
<td width="0" height="828" nowrap="nowrap"></td>
</tr>
</table>
<!-- End ImageReady Slices -->
</body>
</html>
EOD;
mail( "example@example.com", "New Client Info", $body, "From: $bemail" );
?>