PHP 4.0 Bug #6979 Updated: HTTP_*_VARS arrays contain little or no data
| From: | Bug Database | Date: | Tue, 03 Oct 2000 08:06:07 +0000 |
| Subject: | PHP 4.0 Bug #6979 Updated: HTTP_*_VARS arrays contain little or no data | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-34082@lists.php.net to get a copy of this message | ||
ID: 6979
User Update by: webmaster@dtechcomputer.com
Old-Status: Closed
Status: Open
Bug Type: Scripting Engine problem
Description: HTTP_*_VARS arrays contain little or no data
Your script simply displayed exactly what I said above?
Previous Comments:
---------------------------------------------------------------------------
[2000-10-03 02:41:38] waldschrott@php.net
check your php.ini setting "variables_order" and check some configurations, to properly
see what arrays are present in the current page try this snipplet
<?php
function test() {
var_dump($GLOBALS); }
test(); ?>
---------------------------------------------------------------------------
[2000-10-02 20:25:13] webmaster@dtechcomputer.com
I am new to the Apache/PHP world, so if I have made an error in understanding the functions, I
apologize in advance.
Current versions:
Apache 1.3.12 (win32)
PHP 4.0.2
OS WIN98SE
Current ini config:
register_globals = Off
track_vars = On
Problem:
HTTP_*_VARS do not seem to contain data expected?
Example:
From the documentation I understand variables like SERVER_NAME, SCRIPT_NAME, etc, are available
directly as strings variables (i.e. $SERVER_NAME) IF register_globals = On and
'track_vars' set to the opposite state
However, when 'register_globals = Off', they need to be accessed via the 'Global
Variable Arrays' (i.e. HTTP_*_VARS). And from the PHP documentation it seems the syntax for
retrieving this data would be '$HTTP_*_VARS["whatevervariable"].
If $SERVER_NAME = "SOMEHOST.COM" with register_globals = On
I would expect..
$HTTP_SERVER_VARS["SERVER_NAME"] = "SOMEHOST.COM with register_globals = Off
All of the $HTTP_*_VARS arrays seem to be empty (or nearly empty). I do get a valid variable from
"$HTTP_GET_VARS["sid"] when (http://www.php.net?sid=something), but I would expect
the $HTTP_SERVER_VARS{"*"] to contain several values at all times? Most of the other
arrays evaluate as FALSE. (i.e. is_array($HTTP_ENV_VARS) = FALSE, is_array($HTTP_COOKIE_VARS) =
FALSE).
If I have missed or overlooked something here, please enlighten me?!
Thanks in advance
Dave
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=6979