Ok someone pointed out that my php had a colon where a colon needed to be so I was hopeful that would fix my problem. Now I'm getting a new error saying my variables aren't defined. I will post my form page and my php code I am using to try and get it to work. If you can spot what my problem is, that would be awesome.
原帖地å€: TechSpott - Computer and technology forums http://www.techspott.com//showthread.php?p=12864
Here is my form page: https://webservices.missouriwestern.edu/users/aembrey/act202/Publish/Final%20Project/MShoogys/contactus.html
And here is the php code:
<?php
/*Subject and email variables */
$emailSubject = 'Crazy PHP Scripting!';
$webMaster = 'hallyvaux@gmail.com';
/* Gathering Data Variables */
$emailField = $_POST['email'];
$nameField = $_POST['name'];
$phoneField = $_POST['phone'];
$commentsField = $_POST['comments'];
$body = <<<EOD
<br><hr><br>
Email: $email <br>
Name: $name <br>
Phone: $phone <br>
Comments: $comments <br>
EOD;
$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body, $headers);
/* Resulsts rendered as HTML */
$theResults = <<<EOD
<html>
<head>
<title>Email Results</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";
?>
I receive the email but all of the fields are blank. I get an email that says Email: Name: Phone: Comments:
I copied your code and got an error so I stupidly deleted something in the line thinking that would help but now I have it copied exactly as you gave it to me. I get an error when I submit the form which you can see when you submit it as well. Also, I dont get anything coming to my email. Thank you for helping me.
I tried to email you to thank you but stupid yahoo tells me I've exceeded my quota for emails which is odd because I've sent none. Thank you soooo much. You have no idea how happy you've made me!