From:             ccjeagle at ms6 dot hinet dot net
Operating system: FreeBSD4
PHP version:      4.3.3
PHP Bug Type:     Apache related
Bug description:  ErrorDocument redirect 404 vs POST method

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 bug report at http://bugs.php.net/?id=25426&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=25426&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=25426&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=25426&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=25426&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=25426&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=25426&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=25426&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=25426&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=25426&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=25426&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=25426&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25426&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=25426&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=25426&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=25426&r=gnused

Reply via email to