Jump to content

[SOLVED] PHP Script working on one server but not another?


Recommended Posts

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 protected]", $subject, $content, "From: [email protected]" );
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

 

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 -_-

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.

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.

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

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.