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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.