donnacha Posted October 21, 2009 Share Posted October 21, 2009 Hi there, Im a newbie to php and have run into difficulty. when i press submit i get this error. HTTP Error 405 - The HTTP verb used to access this page is not allowed. Internet Information Services (IIS) I will admit that im not really sure what im doing and i hope someone can help. Here is my code: <form action="send_mail.php" method="post"> <table> <tr> <td><font face="Verdana, Arial" color="#888D8F"><font size="-1"><b>Email Adress:</td> <td><input type="text" name="email_address" value="" maxlength="100" /> </td></tr> <tr> <td><font face="Verdana, Arial" color="#888D8F"><font size="-1"><b>Comments:</td> <td><textarea rows="10" cols="50" name="comments"></textarea> </td> </tr> <tr> <td> </td> <td><input type="submit" value="Submit" /> </td> </tr> </table> </form> ....and here is the send_mail.php code <?php $email = $_REQUEST['email_address'] ; $message = $_REQUEST['comments'] ; if (!isset($_REQUEST['email_address'])) { header( "Location: http://www.pdpcrafts.com/Contact Us.html" ); } elseif (empty($email) || empty($message)) { header( "Location: http://www.pdpcrafts.com/error_message.html" ); } else { mail( "[email protected]", "Feedback Form Results", $message, "From: $email" ); header( "Location: http://www.pdpcrafts.com/thank_you.html" ); } ?> Link to comment https://forums.phpfreaks.com/topic/178469-problem-with-php-feedback-form/ Share on other sites More sharing options...
Bricktop Posted October 21, 2009 Share Posted October 21, 2009 Hi donnacha, Replace your $_REQUEST with $_POST, for example: <?php $email = $_POST['email_address'] ; $message = $_POST['comments'] ; if (!isset($_POST['email_address'])) { header( "Location: http://www.pdpcrafts.com/Contact Us.html" ); } elseif (empty($email) || empty($message)) { header( "Location: http://www.pdpcrafts.com/error_message.html" ); } else { mail( "[email protected]", "Feedback Form Results", $message, "From: $email" ); header( "Location: http://www.pdpcrafts.com/thank_you.html" ); } ?> Hope this helps. Link to comment https://forums.phpfreaks.com/topic/178469-problem-with-php-feedback-form/#findComment-941145 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.