Re: PHP 4.0 Bug #2896 Updated: getenv("HTTP_USER_AGENT")returns an empty string

From: Date: Sat, 18 Mar 2000 15:10:14 +0000
Subject: Re: PHP 4.0 Bug #2896 Updated: getenv("HTTP_USER_AGENT")returns an empty string
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-16987@lists.php.net to get a copy of this message
The environment variables are copied into $HTTP_ENV_VARS[], since they don't necessarily have anything to do with the server... On Sat, 18 Mar 2000, Faisal Nasim wrote: > <cut> > > : > : getenv() only works with the low-level environment, and > $HTTP_USER_AGENT > : > is not a part of it. > : > : > : > : > You're talking about the modular version here, right? > : > : Yes. In CGI, the server's way of sending you information is through the > : real environment mechanism, so getenv() would work. In the module version > : (of all of the currently existing servers), these variables aren't defined > : in the environment, but rather, in specialized server tables, that you > : need to access using a special API. The thin server modules do that for > : you, but they don't define the variables in the environment, because it > : would just be plain slow. > > Well, there might be a compability problem if you use the hash > $HTTP_SERVER_VARS, as I just checked that in the CGI version, > you don't copy the env structure into the hash...... can this be added? > -- Zeev Suraski <zeev@zend.com> http://www.zend.com/

« previous php.dev (#16987) next »