php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25426 ErrorDocument redirect 404 vs POST method
Submitted: 2003-09-08 02:59 UTC Modified: 2003-09-08 06:58 UTC
From: ccjeagle at ms6 dot hinet dot net Assigned:
Status: Not a bug Package: Apache related
PHP Version: 4.3.3 OS: FreeBSD4
Private report: No CVE-ID: None
 [2003-09-08 02:59 UTC] 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) ;
?>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-08 06:58 UTC] sniper@php.net
Apparently Apache does not redirect the post data -> not PHP bug.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 11:01:29 2024 UTC