Form Help
Posted: Mon May 11, 2009 10:55 am
I'm attempting to learn php. I thought I had a small grasp and then I did a tutorial on a form that mails you the information filled out in the form.
I built the html file, attached it to the php code, and tested it. It did not send the email but it did give me the text to say that I filled out the form. Which to me says that the code should be working since that is in the php file and not anywhere on the html file.
Any thoughts?
here is the code
and the place where it is stored online if you want to test the html.
http://www.razorbacksrealestate.com/con ... mpage.html
I built the html file, attached it to the php code, and tested it. It did not send the email but it did give me the text to say that I filled out the form. Which to me says that the code should be working since that is in the php file and not anywhere on the html file.
Any thoughts?
here is the code
and the place where it is stored online if you want to test the html.
http://www.razorbacksrealestate.com/con ... mpage.html
Code: Select all
<?php
/* Subject and Email Variables */
$emailsubject = 'Crazy PHP Scripting!';
$webMaster = 'jonathan@bdglr.com';
/* Gathering Data Variables */
$emailField = $_POST['email'];
$emailField = $_POST['name'];
$emailField = $_POST['phone'];
$emailField = $_POST['budget'];
$emailField = $_POST['travelers'];
$emailField = $_POST['comments'];
$emailField = $_POST['newsletter'];
$body = <<<EOD
<br><hr><br>
Email: $email <br>
Name: $name <br>
Phone Number: $phone <br>
Budget: $budget <br>
Number of Travelers: $travelers <br>
Comments: $comments <br>
Newsletter: $newsletter <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>JakesWorks - travel made easy-Homepage</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 interest! Your email will be answered very soon!</div>
</div>
</body>
</html>
EOD;
echo "$theResults";
?>