#25426 [Opn->Bgs]: ErrorDocument redirect 404 vs POST method
| From: | sniper@php.net | Date: | Mon, 08 Sep 2003 10:58:08 +0000 |
| Subject: | #25426 [Opn->Bgs]: ErrorDocument redirect 404 vs POST method | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-47238@lists.php.net to get a copy of this message | ||
ID: 25426
Updated by: sniper@php.net
Reported By: ccjeagle at ms6 dot hinet dot net
-Status: Open
+Status: Bogus
Bug Type: Apache related
Operating System: FreeBSD4
PHP Version: 4.3.3
New Comment:
Apparently Apache does not redirect the post data -> not PHP bug.
Previous Comments:
------------------------------------------------------------------------
[2003-09-08 02:59:17] ccjeagle at ms6 dot hinet dot net
Description:
------------
Hi all
I posted this on general list but got no reply. Is it a bug?
Envirement: PHP-4.3.3, Apache 1.3.28 / 2.0.47
php.ini : always_populate_raw_post_data is set to ON
httpd.conf : ErrorDocument 404 /error.php
Now I want the error.php handle all the 404 Not Found status,
especially the POST/GET data.
So I created a small script named posttest.php:
<!-- File : posttest.php -->
<form action="nonexist.php" method="POST">
....
WITHOUT the nonexist.php, the apache REDIRECT to error.php, of course.
But I could only get these variables in error.php:
$_SERVER["REDIRECT_REQUEST_METHOD"]="POST"
$_SERVER["REDIRECT_STATUS"]=404
With the $_POST and $HTTP_RAW_POST_DATA left EMPTY.
So does the php://input .
I know if I change the method to GET, the error.php script could get
the GET
data
via $_SERVER["REDIRECT_QUERY_STRING"].
But I really need to take care of the POST method. Any idea to solve
this ?
Thanks.
Regards,
CCJ
Reproduce code:
---------------
<?php
// File : error.php
readfile("php://input") ;
print_r($GLOBALS) ;
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25426&edit=1