Hi anyone - I am writing a script to pass the form fields from a html form page through to a php e-mail function called thanks.php which contains a confirmation page and also a php script to send the results of the form to an e-mail address inside a html code within <?php...?> tags. The $Contact, $EMail etc. pass in php formatted $msg format but I don't know how to send the Contact and other fields inside the html tags. I have tried various ways but it won't send the field results. Can anyone help?
I have tried $Contact
and
<?php echo $_POST["Contact"]; ?>
I don't know what other commands there are, I have found out this much through tutorials. Is there a website which covers the basics of learning more php?
here is a sample of the code:
<?php
$subject = "Contact Me! Form Results from website www.JCCmedia.org";
$to_address = "$Contact <$EMail>";
$message = '
<html>
<body>
<p font face="Verdana"><font face="Verdana" size="2">Hi <?php echo $POST["Contact"]; ?>,</font></p>
<p><font face="Verdana" size="2">You are receiving this e-mail because you have submitted the following details to our "Contact Form" on our website.</font></p>
<p><b><font face="Verdana" size="2">The details are as follows:</font></b></p>
<div align="left">
<table border="0" cellpadding="10" cellspacing="0" width="100%">
<tr>
<td width="100%">
<div align="left">
<table border="0" cellpadding="0" cellspacing="0" width="400">
<tr>
<td width="50%" valign="top" align="left"><font face="Verdana" size="2"><b>Your Name:</b></font>
<p> </td>
<td width="50%" valign="top" align="left"><font face="Verdana" size="2"><?php echo $POST["Contact"]; ?></font></td>
</tr>
<tr>
<td width="50%" valign="top" align="left"></td>
<td width="50%" valign="top" align="left"></td>
</tr>
<tr>
<td width="50%" valign="top" align="left"><font face="Verdana" size="2"><b>Your Address:</b></font></td>
<td width="50%" valign="top" align="left"><font face="Verdana" size="2"><?php echo $POST["Address1"]; ?></font></td>
</tr>
<tr>
<td width="50%" valign="top" align="left"></td>
<td width="50%" valign="top" align="left"><font face="Verdana" size="2"><?php echo $POST["Address2"]; ?></font></td>
</tr>
<tr>
<td width="50%" valign="top" align="left"></td>
<td width="50%" valign="top" align="left"><font face="Verdana" size="2"><?php echo $POST["Address3"]; ?></font></td>
</tr>
<tr>
<td width="50%" valign="top" align="left"></td>
<td width="50%" valign="top" align="left"><font face="Verdana" size="2"><?php echo $POST["City"]; ?></font></td>
</tr>
<tr>
<td width="50%" valign="top" align="left"></td>
<td width="50%" valign="top" align="left"><font face="Verdana" size="2"><?php echo $POST["PostCode"]; ?></font></td>
</tr>
<tr>
<td width="50%" valign="top" align="left">
<p> </td>
<td width="50%" valign="top" align="left"><font face="Verdana" size="2"><?php echo $POST["Country"]; ?></font></td>
</tr>
<tr>
<td width="50%" valign="top" align="left"></td>
<td width="50%" valign="top" align="left"></td>
</tr>
<tr>
<td width="50%" valign="top" align="left"><font face="Verdana" size="2"><b>Your Phone No:</b></font></td>
<td width="50%" valign="top" align="left"><font face="Verdana" size="2"><?php echo $POST["Phone"]; ?></font></td>
</tr>
<tr>
<td width="50%" valign="top" align="left"><font face="Verdana" size="2"><b>Your Fax No:</b></font></td>
<td width="50%" valign="top" align="left"><font face="Verdana" size="2"><?php echo $POST["Fax"]; ?></font></td>
</tr>
<tr>
<td width="50%" valign="top" align="left"><font face="Verdana" size="2"><b>Your Email Address:</b></font></td>
<td width="50%" valign="top" align="left"><font face="Verdana" size="2"><?php echo $POST["EMail"]; ?></font></td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td width="100%">
<div align="left">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="35%" valign="top" align="left"><font face="Verdana" size="2"><b>The
service you are interested in:</b></font></td>
<td width="64%" valign="top" align="left"><font face="Verdana" size="2"><?php echo $POST["I_am_interested_in"]; ?></font></td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td width="100%">
<div align="left">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="35%" valign="top" align="left"><font face="Verdana" size="2"><b>My intended use for a website is:</b></font></td>
<td width="64%" valign="top" align="left"><font face="Verdana" size="2"><?php echo $POST["Type_of_use"]; ?></font></td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td width="100%">
<div align="left">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="100%" valign="top" align="left"><font face="Verdana" size="2"><b>The
extra details you have provided are:</b></font>
<p> </td>
</tr>
<tr>
<td width="100%" valign="top" align="left"><font face="Verdana" size="2"><?php echo $POST["Info"]; ?></font></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</div>
<p font face="Verdana"><font face="Verdana" size="2">You do not need to reply to this e-mail. If the details above are not correct, please visit the link below and re-submit.</font></p>
<p align="center" font face="Verdana"><a href="http://www.JCCmedia.org/contact_me.htm"><font face="Verdana" size="2">http://www.JCCmedia.org/contact_me.htm</font></a></p>
<p align="center" font face="Verdana"><b><font face="Verdana" size="2">Thank you for your valuable information, we shall contact you by e-mail at <?php echo $_POST["EMail"]; ?> within the next 24 hours!</font></b></p>
<font face="Verdana" size="10pt">
<hr></font>
<p font face="Verdana"><font face="Verdana" size="2">John Crook,<br>Support, <a href="mailto:support@jccmedia.org">support@JCCmedia.org</a><br><a href="http://www.JCCmedia.org">www.JCCmedia.org</a></font></p>
</body>
</html>
';
$headers = "Content-Type: text/html; charset=windows-1252\n";
$headers .= "From: Support <support@jccmedia.org>\n";
$headers .= "Bcc: Support <support@jccmedia.org>\n";
mail($to_address, $subject, $message, $headers);
?>