Jump to content

HTTP Error - 405


Howdy_McGee

Recommended Posts

So I don't know too much about PHP or creating forms, this is my first try here. I'm using a Network Solutions web hosting. When ever I submit the form it goes to my sendmail.php page and give me an HTTP Error - 405 (page cannot be displayed) and never sends the form.Here's the code I'm using

<?php  $email = $_POST['email'];  $message = $_POST['message'];  mail( "myemail@myemail.com", "Feedback Form Results",	$message, "From: $email" );  header( "Location: http://www.google.com" );?>

very simple. I don't think the problem would lie in the HTML. Anyone have a solution to my problem? Where do I go from here?HTML Code

<form method="post" action="sendmail.php">   Email: <input name="email" type="text" /><br />   Message:<br />   <textarea name="message" rows="15" cols="40">   </textarea><br />   <input type="submit" /> </form>

Link to comment
Share on other sites

A little :) search reveals that 405 is a status associated with trying to use the POST method on a server not configured to support it / configured to not support it. Try using GET and see if that fixes things. If so, you'll need to contact your host about enabling POST.

Link to comment
Share on other sites

can i host sendmail.php on another server and have it connect to the form still, send it that way?
A few security issues arise from doing such a thing, one tiny one called XSS for a start.So I wouldn't recommend it.
Link to comment
Share on other sites

There are ways to secure an interface on another server, such as through the use of API keys. But it's probably not worth it.

Link to comment
Share on other sites

The alternative if you need to hold on to values which you can't have in the URL, such as passwords, is to store those details in the session variable, which is stored server side and is quite secure from prying eyes. But POST is a heck of a lot easier than having to manage what you're storing in the session array. Worth getting on to your hosting company or getting a new hosting company.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...