#38094 [Opn->Bgs]: Custom 404 does not receive POST variables
| From: | jani@php.net | Date: | Wed, 15 Aug 2007 08:31:02 +0000 |
| Subject: | #38094 [Opn->Bgs]: Custom 404 does not receive POST variables | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-116142@lists.php.net to get a copy of this message | ||
ID: 38094
Updated by: jani@php.net
Reported By: mdcore at gmail dot com
-Status: Open
+Status: Bogus
Bug Type: IIS related
Operating System: win32
PHP Version: 5.1.4
New Comment:
It's hard for PHP to mangle those variables since it sets them to
whatever IIS says them to be. So obviously you can't POST to custom 404
anymore. You should use $_REQUEST to refer to variables passed in such
cases where you can't be sure where they come from. ;)
IIS bugs are not PHP bugs -> bogus.
Previous Comments:
------------------------------------------------------------------------
[2006-09-18 20:41:27] dangos at gmail dot com
I have confimed this issue, and it _is_ a PHP bug. When presented with
an HTTP POST through an IIS 6 custom error handler, PHP receives the raw
POST data into php://input, but fails to parse it into $_POST etc.
For comparison, ASP scripts do receive POST variables from IIS 6 custom
error handlers, whereas PHP scripts do not. PHP also mangles
$_SERVER['QUERY_STRING'] and $_GET and incorrectly reports
$_SERVER['REQUEST_METHOD'] as 'GET' in this situation.
I can suggest that the likely reason for the above problems is that
when presenting a custom error to a script ISAPI filter IIS6 prepends
the error status code to the beginning of the URL (e.g.
404;http://www.example.com/) - this odd format is possibly
causing
confusion when PHP attempts to process the server variables.
------------------------------------------------------------------------
[2006-07-13 12:57:46] mdcore at gmail dot com
Thanks for responding so quickly Tony!
I think it is a bug in the PHP ISAPI filter because if I use a custom
404 ASP page then the POST variables do come through. It's only with PHP
pages that it does not work.
------------------------------------------------------------------------
[2006-07-13 12:53:30] tony2001@php.net
It clearly DOES pass them, as you said it yourself:
>this works in IIS5 but not in IIS6.
Please report it to Microsoft.
------------------------------------------------------------------------
[2006-07-13 12:47:44] mdcore at gmail dot com
Why is the PHP ISAPI filter not passing the POST variables to the
script?
------------------------------------------------------------------------
[2006-07-13 12:38:08] mdcore at gmail dot com
Description:
------------
I'm using a custom 404 page in IIS to handle a form of mod_rewrite. But
if I post a form then the custom 404 does not get the POST variables.
this works in IIS5 but not in IIS6.
Reproduce code:
---------------
formtest.php:
<form method="post" action="non_existant_page.abc">
<input name="test" type="text" value="some stuff" />
<input type="submit" />
</form>
Set this up as a custom 404 page in IIS.
custom404.php:
<pre><?
print_r($GLOBALS);
?></pre>
Expected result:
----------------
non-empty _FORM and REQUEST_METHOD of POST
Actual result:
--------------
empty _FORM and REQUEST_METHOD of GET
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38094&edit=1