PHP help!! Can you tell me what is wrong with this code?

Grant

New member
When I receive the email from my contact form I only get the category heading not any data.
For example this is all i receive:

Name:
Contact details:
Comments:

This is my code:

<?php

/* Email Variables */

$emailSubject = 'contactformprocess!';
$webMaster = '[email protected]';


/* Data Variables */

$contact = $_POST['Contact details'];
$name = $_POST['Name'];
$comments = $_POST['Comments'];



$body = <<<EOD
<br><hr><br>
Name: $name <br>
Contact details: $contact <br>

Comments: $comments <br>
EOD;


$headers = "From: $Contact details\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body,
$headers);


/* Results rendered as HTML */

$theResults = <<<EOD
<html>
<head>
<title>sent message</title>
<meta http-equiv="refresh" content="3;URL=http://www.example.co.uk/">
<style type="text/css">
<!--
body {
background-color: #444;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 20px;
font-style: normal;
line-height: normal;
font-weight: normal;
color: #fec001;
text-decoration: none;
padding-top: 200px;
margin-left: 150px;
width: 800px;
}

-->
</style>
</head>
<div align="center">Your email will be answered soon as possible!
</div>
</div>
</body>
</html>
EOD;
echo "$theResults";
?>



Please help me figure where I have gone wrong! Thanks.
 
Back
Top