|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-01-27 04:14 UTC] pliszka at bellatlantic dot net
[2002-05-24 20:34 UTC] derick@php.net
[2004-09-15 16:31 UTC] jaapjp at zonnet dot nl
[2004-10-02 09:09 UTC] ananth_rs at hotmail dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 08:00:01 2025 UTC |
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...