Bug #10804 Updated: No HTTP_POST_VARS
| From: | derick@php.net | Date: | Sat, 25 May 2002 00:34:22 +0000 |
| Subject: | Bug #10804 Updated: No HTTP_POST_VARS | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-8479@lists.php.net to get a copy of this message | ||
ID: 10804
Updated by: derick@php.net
Reported By: hectorp@buckfoodsvc.com
-Status: Open
+Status: Bogus
Bug Type: Other web server
Operating System: Windows 2000
PHP Version: 4.0.5
New Comment:
Thank you for taking the time to report a problem with PHP.
Unfortunately your version of PHP is too old -- the problem
might already be fixed. Please download a new PHP
version from http://www.php.net/downloads.php
If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.
Previous Comments:
------------------------------------------------------------------------
[2002-01-27 04:14:45] pliszka@bellatlantic.net
I have the same problem.
PHP 4
IIS 4
Windows NT 4.0 Server
------------------------------------------------------------------------
[2001-05-11 04:17:32] hectorp@buckfoodsvc.com
PHP 4.0.5 and 4.0.4pl1 (tried the latter as a fallback) downloaded as
binaries from your php.net site, running Xitami. Also tried on a
Windows ME machine and got the same results, which are:
POSTing from a form does not result in the $HTTP_POST_VARS array being
created. It also doesn't create the global versions of these variables
(with register_globals on or off). However, it _does_ create
appropriate entries in $HTTP_ENV_VARS['FORM_*'] and
$HTTP_SERVER_VARS['FORM_*']. Additionally, $HTTP_COOKIE_VARS show up
fine (unrelated, just FYI).
I used this code to "emulate" (badly) the HTTP_POST_VARS variables,
just to be sure that was really the problem:
if(count($HTTP_POST_VARS) < 2) { // test always succeeds
reset($HTTP_ENV_VARS); // is set, but is 0 size
while(list($k,$v) = each($HTTP_ENV_VARS)) {
if(!strncmp($k,"FORM_",5)) {
$g = strtolower(substr($k,5));
$HTTP_POST_VARS[$g] = $v; // create fake array var
$$g = $v; // create fake global var
}
}
}
I tried several scripts from the internet (Phorum, etc.) and had the
same problem with all, whenever a form POSTed, on both machines using
both versions of PHP. Even a form with only a simple submit button
fails without the above hack. This is bizaare.
Here are some typical results from phpinfo() after a POST:
This is from the Environment section:
QUERY_METHOD POST
REQUEST_METHOD POST
...
FORM_SET Login
FORM_AUTHKEY
FORM_AUTHPASS 22222222
FORM_AUTHUSER Myadmin23
FORM_REFERERURL http://forum.hectorplasmic.com/frontpage.php
This is from the PHP Variables section:
HTTP_SERVER_VARS["QUERY_METHOD"] POST
HTTP_SERVER_VARS["REQUEST_METHOD"] POST
...
HTTP_SERVER_VARS["FORM_SET"] Login
HTTP_SERVER_VARS["FORM_AUTHKEY"]
HTTP_SERVER_VARS["FORM_AUTHPASS"] 22222222
HTTP_SERVER_VARS["FORM_AUTHUSER"] Myadmin23
HTTP_SERVER_VARS["FORM_REFERERURL"]
http://forum.hectorplasmic.com/frontpage.php
So is this:
HTTP_ENV_VARS["QUERY_METHOD"] POST
HTTP_ENV_VARS["REQUEST_METHOD"] POST
HTTP_ENV_VARS["GATEWAY_INTERFACE"] CGI/1.1
HTTP_ENV_VARS["SERVER_SECURITY"] -
HTTP_ENV_VARS["SERVER_PROTOCOL"] HTTP/1.1
HTTP_ENV_VARS["SERVER_PORT"] 80
...
HTTP_ENV_VARS["SERVER_VERSION"] 2.5b1
HTTP_ENV_VARS["SERVER_SOFTWARE"] Xitami
HTTP_ENV_VARS["FORM_SET"] Login
HTTP_ENV_VARS["FORM_AUTHKEY"]
HTTP_ENV_VARS["FORM_AUTHPASS"] 22222222
HTTP_ENV_VARS["FORM_AUTHUSER"] Myadmin23
HTTP_ENV_VARS["FORM_REFERERURL"]
http://forum.hectorplasmic.com/frontpage.php
So is this, but they're my "fake" variables created by the code above.
These don't show up without that code -- no HTTP_POST_VARS at all.
HTTP_POST_VARS["set"] Login
HTTP_POST_VARS["authkey"]
HTTP_POST_VARS["authpass"] 22222222
HTTP_POST_VARS["authuser"] Myadmin23
HTTP_POST_VARS["refererurl"]
http://forum.hectorplasmic.com/frontpage.php
Here's the form (stripped of HTML formatting crud):
<form method="post" action="/login.php" name="login">
<input type="hidden" name="refererurl"
value="http://forum.hectorplasmic.com/frontpage.php"><br>
Username: <input class="inp" type="text" name="authUser">
Userpass: <input class="inp" type="password" name="authPass">
Activation code: <input class="inp" type="text"
name="authKey">
<input class="button" type="submit" name="set"
value="Login">
<input class="button" type="reset" name="reset"
value="Clear">
</form>
I beat my head on the wall trying to figure it out -- obviously, this
hasn't been happening to very many people, or you'd be flooded with
complaints -- but I give up, I'm whupped. Any ideas?
After I get some sleep, I may try PHP 3.x just to see if the problem
remains...
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=10804&edit=1