php script help

Newbie trying to create a php script to email me the results of a form submission. I am getting an email returned to me, but none of the results… it’s driving me crazy! Any help would be great. php below:

<?php /* Subject and Email Variables */ $emailSubject = 'OneSource Web Estimate Request'; $webMaster = 'my email address here'; /* gathering data variables */ $nameField = $_POST['name']; $companyField = $_POST['company']; $address1Field = $_POST['address1']; $address2 = $_POST['address2']; $cityField = $_POST['city']; $stateField = $_POST['state']; $zipcodeField = $_POST['zipcode']; $phoneField = $_POST['phone']; $emailField = $_POST['email']; $descriptionField = $_POST['projectdescription']; $body = <<<EOD

Name: $name
Company: $company
Address: $address1
Address2: $address2
City: $city
State: $state
Zip: $zipcode
Phone: $phone
Email: $email
Description: $projectdescription
EOD; $headers .= "Content-type: text/html\r\n"; $success = mail($webMaster, $emailSubject, $body, $headers); /* Results rendered as html */ $theResults = <<<EOD ThankYou body { background-image: url(images/bg.jpg); background-repeat: repeat-x; } #body { width: 500px; margin-right: auto; margin-left: auto; margin-top: 200px; font-family: Arial, Helvetica, sans-serif; font-size: 16pt; }

Your Request has been submitted. A representative will be contacting you with your estimate shortly.

Thank You!

EOD; echo "$theResults"; ?>

[php]$nameField = $_POST[‘name’];

Name: $name[/php]

do you mean:

[php]Name: $nameField[/php]

same for rest of code…


Thanks for helping me out!!! fixed!

No worries, happy to help :wink:

Sponsor our Newsletter | Privacy Policy | Terms of Service