thesecraftonlymultiply Posted August 10, 2008 Share Posted August 10, 2008 Hi all, Excuse my ignorance. I have some coding ability but it is very limited... I have written a simple sendmail script as follows: <?php $name = $_REQUEST['name']; $email = $_REQUEST['email']; $enquiry = $_REQUEST['enquiry']; $subject = "Booking Enquiry: " . $name; $content = "Enquiry: \n" . $enquiry . "\n \n Email: \n" . $email; mail( "email@email.com", $subject, $content, "From: email@email.com" ); header( "Location: redirect.html" ); ?> This works fine on my server but on the clients server it does not execute correctly and an error pages appears: The page cannot be displayed The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access. Please try the following: * Contact the Web site administrator if you believe that this request should be allowed. * Make sure that the Web site address displayed in the address bar of your browser is spelled and formatted correctly. HTTP Error 405 - The HTTP verb used to access this page is not allowed. Internet Information Services (IIS) Technical Information (for support personnel) * Go to Microsoft Product Support Services and perform a title search for the words HTTP and 405. * Open IIS Help, which is accessible in IIS Manager (inetmgr), and search for topics titled Setting Application Mappings, Securing Your Site with Web Site Permissions, and About Custom Error Messages. I am at a bit of a loss as to why this is happening... Is it anything to do with the version of PHP installed on the clients server? How "fail-safe" and transferable is my code? I wouldn't have thought it be that complicated to not execute in previous or older versions of PHP. If anyone can help I would greatly appreciate it. Thanks in advance and best wishes, Luke Quote Link to comment Share on other sites More sharing options...
cooldude832 Posted August 10, 2008 Share Posted August 10, 2008 $_REQUEST is the problem probably use $_GET or $_POST the method that best reflect where the variables are set. Quote Link to comment Share on other sites More sharing options...
thesecraftonlymultiply Posted August 11, 2008 Author Share Posted August 11, 2008 Thanks for your reply I've tried using POST AND GET to no avail. Any other ideas? Thanks in advance. Luke Quote Link to comment Share on other sites More sharing options...
discomatt Posted August 11, 2008 Share Posted August 11, 2008 HTTP Error 405 - The HTTP verb used to access this page is not allowed. Internet Information Services (IIS) This isn't PHP, this is your WEB SERVER reporting an error. http://www.somacon.com/p126.php BTW - IIS is garbage Quote Link to comment Share on other sites More sharing options...
DarkWater Posted August 11, 2008 Share Posted August 11, 2008 IIS is really bad. Reallllllly bad. The error is because of IIS, not PHP. Although you should never use $_REQUEST regardless. Quote Link to comment Share on other sites More sharing options...
discomatt Posted August 11, 2008 Share Posted August 11, 2008 IIS is really bad. Reallllllly bad. The error is because of IIS, not PHP. Although you should never use $_REQUEST regardless. Both are derived from the client... I don't see the issue. I can modify POST vars almost as easily as GET. Both should be equally sanitized. Quote Link to comment Share on other sites More sharing options...
DarkWater Posted August 11, 2008 Share Posted August 11, 2008 IIS is really bad. Reallllllly bad. The error is because of IIS, not PHP. Although you should never use $_REQUEST regardless. Both are derived from the client... I don't see the issue. I can modify POST vars almost as easily as GET. Both should be equally sanitized. I can modify either easily too, but you don't know what the source is. It's easier to track your variables and where they're coming from by using the right superglobal. It might all come down to programming preference in the end, but I'd like to know which variables are which. Quote Link to comment Share on other sites More sharing options...
discomatt Posted August 11, 2008 Share Posted August 11, 2008 Yes, using GET/POST variables with the same name may begin to cause headaches. I would avoid using it as a beginner coder. The 'never' word in there is a little strong though, I would say Quote Link to comment Share on other sites More sharing options...
thesecraftonlymultiply Posted August 11, 2008 Author Share Posted August 11, 2008 Thanks for the quick responses! So basically this is not my problem... it is a problem with the web server is that what you are saying? As in there is nothing I can do to make this script work? Thanks again and sorry to be a pain, I am learning alot here though Luke Quote Link to comment Share on other sites More sharing options...
discomatt Posted August 11, 2008 Share Posted August 11, 2008 If you do not have access to the web server, then there's nothing you can do. Quote Link to comment Share on other sites More sharing options...
thesecraftonlymultiply Posted August 11, 2008 Author Share Posted August 11, 2008 Thanks discomatt. I'll send over the link that you pasted in your previous post to the client. Have a good day and best regards, Luke Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.