From: hcg26 at cam dot ac dot uk
Operating system: Linux vnm2 2.4.27 #4 SMP
PHP version: 4.3.8
PHP Bug Type: Variables related
Bug description: PHP loses POST data when HTTP authentication is used
Description:
------------
On a Linux Apache server (1.3.31), PHP loses request variables when they
were sent using the POST method and the script is protected via .htaccess
authentication
(bug produced with user & password authentication).
The form data are nowhere to be found, not in $_REQUEST or $_POST.
My $_SERVER is as follows:
(
[CONTENT_LENGTH] => 21
[CONTENT_TYPE] => application/x-www-form-urlencoded
[DOCUMENT_ROOT] => /home/www/<host name>/htdocs
[HTTP________] => ----:-------------------------------
[HTTP________________] => ----- -------
[HTTP_ACCEPT] => image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/vnd.ms-excel, application/vnd.ms-powerpoint,
application/msword, application/x-shockwave-flash, */*
[HTTP_ACCEPT_LANGUAGE] => de
[HTTP_CACHE_CONTROL] => no-cache
[HTTP_CONNECTION] => Keep-Alive
[HTTP_HOST] => <host name>
[HTTP_USER_AGENT] => Mozilla/4.0 (compatible; MSIE 6.0; Windows NT
5.1; iOpus-I-M)
[PATH] => /sbin:/bin:/usr/sbin:/usr/bin
[REMOTE_ADDR] => 217.236.36.198
[REMOTE_PORT] => 2029
[SCRIPT_FILENAME] => /home/www/<host name>/htdocs/v1/phpbug/test.php
[SCRIPT_URI] => http://<host name>/v1/phpbug/test.php
[SCRIPT_URL] => /v1/phpbug/test.php
[SERVER_ADDR] => 81.3.18.152
[SERVER_ADMIN] => <removed>
[SERVER_NAME] => <host name>
[SERVER_PORT] => 80
[SERVER_SIGNATURE] =>
[SERVER_SOFTWARE] => Apache/1.3.31 (Unix) mod_ssl/2.8.19
OpenSSL/0.9.7d PHP/4.3.8
[UNIQUE_ID] => QU7XaH8AAAEAAASeDko
[GATEWAY_INTERFACE] => CGI/1.1
[SERVER_PROTOCOL] => HTTP/1.1
[REQUEST_METHOD] => POST
[QUERY_STRING] =>
[REQUEST_URI] => /v1/phpbug/test.php
[SCRIPT_NAME] => /v1/phpbug/test.php
[PATH_TRANSLATED] => /home/www/<host name>/htdocs/v1/phpbug/test.php
[PHP_SELF] => /v1/phpbug/test.php
)
Reproduce code:
---------------
-- html input form
<form action="phpbug/test.php" method=post>
POST <input type=text name="a"> <input type=submit>
<hr>
<form action=phpbug/test.php" method=get>
GET <input type=text name="a"> <input type=submit>
--php script
<?php
echo "<pre>";
print_r($_POST);
echo "--";
print_r($_REQUEST);
echo "--";
print_r($_SERVER);
?>
Expected result:
----------------
Array
(
[a] => dfdsfds
)
--Array
(
[a] => dfdsfds
)
[as obtained when using the GET method]
Actual result:
--------------
Array
(
[a] =>
)
--Array
(
[a] =>
)
NOTE: the $_SERVER[CONTENT_LENGTH] is correct.
--
Edit bug report at http://bugs.php.net/?id=30169&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30169&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30169&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30169&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=30169&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=30169&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=30169&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=30169&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=30169&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=30169&r=support
Expected behavior: http://bugs.php.net/fix.php?id=30169&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=30169&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=30169&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=30169&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30169&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=30169&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=30169&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=30169&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=30169&r=float
MySQL Configuration Error: http://bugs.php.net/fix.php?id=30169&r=mysqlcfg