newbie PHPform emailer issues
Posted: Fri Aug 21, 2009 11:24 am
Hi Forum,
I am new to this forum and php scripting. I have a form designed in DW and I have have attached the below script.
My problem is when I submit the form, I only get the body sections without the variables i.e: ProjectType: Budget: Description: and so forth! I am using godaddy for hosting. Funny thing is I have used the same script on another website hosted by a different co. and it works fine.
Your help will be much appreciated as for the life of me I dont understand why its not submitting the variables.
Thanks in advance.
Frustrated member.
<?php
/* Subject and Email Variables */
$emailSubject = 'smartsdesign enquiry';
$webMaster = 'info@smartsdesign.co.uk';
/* Gathering Data Variables */
$projectTypeField = $_POST['project'];
$projectBudgetField = $_POST['budget'];
$projectDescriptionField = $_POST['description2'];
$nameField = $_POST['name'];
$emailField = $_POST['email'];
$phoneField = $_POST['phone'];
$contactbyField = $_POST['contact'];
$body = <<<EOD
<br><hr><br>
ProjectType: $project <br>
Budget: $budget <br>
Description: $description2 <br>
name: $name <br>
email: $email <br>
phone: $phone <br>
contact: $contact <br>
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
EOD;
echo "$theResults";
?>
I am new to this forum and php scripting. I have a form designed in DW and I have have attached the below script.
My problem is when I submit the form, I only get the body sections without the variables i.e: ProjectType: Budget: Description: and so forth! I am using godaddy for hosting. Funny thing is I have used the same script on another website hosted by a different co. and it works fine.
Your help will be much appreciated as for the life of me I dont understand why its not submitting the variables.
Thanks in advance.
Frustrated member.
<?php
/* Subject and Email Variables */
$emailSubject = 'smartsdesign enquiry';
$webMaster = 'info@smartsdesign.co.uk';
/* Gathering Data Variables */
$projectTypeField = $_POST['project'];
$projectBudgetField = $_POST['budget'];
$projectDescriptionField = $_POST['description2'];
$nameField = $_POST['name'];
$emailField = $_POST['email'];
$phoneField = $_POST['phone'];
$contactbyField = $_POST['contact'];
$body = <<<EOD
<br><hr><br>
ProjectType: $project <br>
Budget: $budget <br>
Description: $description2 <br>
name: $name <br>
email: $email <br>
phone: $phone <br>
contact: $contact <br>
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
EOD;
echo "$theResults";
?>