I'm totally new to PHP and I'm attempting to put together my first form on my website using Dreamweaver CS3. I watched a tutorial, downloaded the necessary code, replaced my variables within, linked it, and uploaded all of it. I am able to view my website/form online, fill in all the information needed, but when I hit submit, I'm prompted to "open, save, or cancel" the PHP file. I hit cancel, and within a few minutes I've received an email in my inbox from "UnknownSender@UnknownSender.com" with all of my body information, but everything I typed in the fields from the website is blank.
Any suggestions?
thanks!
here's my code below:
<?php
/ Subject and Email Variables /
$emailSubject = 'Online Order Submission';
$webMaster = 'klr7475@aol.com';
/ gathering data variables /
$nameField = $_POST['name'];
$emailField = $_POST['email'];
$paddressField = $_POST['paddress'];
$cszField = $_POST['csz'];
$altphoneField = $_POST['altphone'];
$daddressField = $_POST['daddress'];
$townField = $_POST['town'];
$rentalcompanyField = $_POST['rentalcompany'];
$housenameField = $_POST['housename'];
$deliverydayField = $_POST['deliveryday'];
$ddateField = $_POST['ddate'];
$yearField = $_POST['year'];
$grocerystore = $_POST['grocerystore'];
$grocerylistField = $_POST['grocerylist'];
$body = <<<EOD
<br><hr><br>
Name: $name <br>
Email: $email <br>
Permanent Address: $paddress <br>
City State Zip: $csz <br>
Cell Phone: $altphone <br>
Delivery Address: $daddress <br>
Town: $town <br>
Rental Company: $rentalcompany <br>
Rental House Name: $housename <br>
Delivery Day: $deliveryday <br>
Delivery Date: $ddate <br>
Year: $year <br>
Preferred Grocery Store: $grocerystore <br>
Grocery List: $grocerylist <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
<html>
<head>
<title>Your Taste My Time - An Outer Banks Grocery Delivery Service</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
background-color: #f1f1f1;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
font-style: normal;
line-height: normal;
font-weight: normal;
color: #666666;
text-decoration: none; }
-->
</style>
</head>
<div>
<div align="left">Thank you for your order! Your email will be answered very soon!</div>
</div>
</body>
</html>
EOD;
echo "$theResults";
?>