newbie PHPform emailer issues

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
smartsdesign
Forum Newbie
Posts: 2
Joined: Fri Aug 21, 2009 11:13 am

newbie PHPform emailer issues

Post 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";
?>
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: newbie PHPform emailer issues

Post by jackpf »

I don't see where you're setting any of the variables used in the email body.
smartsdesign
Forum Newbie
Posts: 2
Joined: Fri Aug 21, 2009 11:13 am

Re: newbie PHPform emailer issues

Post 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.
Post Reply