I created a form on a website that will email me the results. I started by creating the file contact.php, then I created sendmail.php. At first I had the form at http://www.xxxxxxxx.com/contact.php, and everything worked fine. After several test I copied the form onto my html contact page and I never recieved any results, but everything seemed to work fine. Anyone have any ideas? I’m a fairly new at php so please don’t bash!
contact.php code
[php]
Your Name:
Phone:
Your Email:
Policy:
Brief Description:
sendmail.php code
<?php $email = $_REQUEST['email'] ; $message = $_REQUEST['message'] ; if (!isset($_REQUEST['email'])) { header( "Location: http://www.XXXXXXXXXX.com/thankyou.html" ); } elseif (empty($email) || empty($message)) { ?><html>
<head><title>Error</title></head>
<body>
<h1>Error</h1>
<p>
It appears you forgot to enter something in one of the fields. Please press the back button on your browser and try again.
</p>
</body>
</html>
<?php
}
else {
mail( "[email protected]", “Feedback Form Results”,
$message, “From: $email” );
header( “Location: http://www.XXXXXXXXXXXX.com/thankyou.html” );
}
?>[/php]
**Mod Edit - Added php bb tags for readability.