I have a simple form that should send the results to a hotmail email address. It then displays a thank you page to the visitor and finally redirect to another page - for this example Google.
Everything seems to work except the results do not get sent to the email - can anyone help?
I think it might be to do with the checkboxes - how are these processed to email?
Here is the code:
The Form - survey.html
[code]
Untitled DocumentName: | |
Continent |
Asia
|
Favourite Color |
Orange
|
Your Comments: | |
[/code]
The PHP - check.php
[php]<?php
/Subject and Email Variables/
$emailSubject = ‘check.php’;
$webMaster = ‘substituteyouremailhere’;
/Gathering Data Variables/
$name = $_POST[‘name’];
$continent = $_POST[‘continent’];
$color = $_POST[‘color’];
$othercolor = $_POST[‘othercolor’];
$comments = $_POST[‘comments’];
$body = <<<EOD
Visitors Name: $name
Visitors Continent: $continent
Visitors Favourite Color: $color
Other Favourite Color: $othercolor
EOD;
$headers = “From: $email\r\n”;
$headers .= “Content-type: text/html\r\n”;
$success = mail($webMaster, $emailSubject, $body, $headers);
/* Results rendered as HTML */
$theResults = <<<EOD
Success - Thanks for completing the Form - We will get back to you soon!
EOD; echo "$theResults"; ?> [/php]Any help would be great - thanks