#38094 [Com]: Custom 404 doesnt receive POST variables

From: Date: Mon, 18 Sep 2006 20:41:27 +0000
Subject: #38094 [Com]: Custom 404 doesnt receive POST variables
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-102370@lists.php.net to get a copy of this message
ID: 38094 Comment by: dangos at gmail dot com Reported By: mdcore at gmail dot com Status: Open Bug Type: IIS related Operating System: 2003 PHP Version: 5.1.4 New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [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:43:19] tony2001@php.net Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. ------------------------------------------------------------------------ [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

« previous php.bugs (#102370) next »