Page 1 of 1

newbie PHPform emailer issues

Posted: Fri Aug 21, 2009 11:24 am
by smartsdesign
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";
?>

Re: newbie PHPform emailer issues

Posted: Sat Aug 22, 2009 6:17 am
by jackpf
I don't see where you're setting any of the variables used in the email body.

Re: newbie PHPform emailer issues

Posted: Sat Aug 22, 2009 3:16 pm
by smartsdesign
jackpf wrote:I don't see where you're setting any of the variables used in the email body.
Thanks for the reply. I have found another script that works. much appreciated.