Re: PHP 4.0 Bug #2896 Updated: getenv("HTTP_USER_AGENT") returns an empty string
| From: | Zeev Suraski | Date: | Sat, 18 Mar 2000 14:58:12 +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-16985@lists.php.net to get a copy of this message | ||
On Sat, 18 Mar 2000, Faisal Nasim wrote:
> : ID: 2896
> : Updated by: zeev
> : Reported By: jim@smilie.com
> : Status: Closed
> : Bug Type: Misbehaving function
> : Assigned To:
> : Comments:
> :
> : HTTP_USER_AGENT is not an environment variable, but rather
> : a server variable. As of PHP 4b4, you can access it through
> $HTTP_SERVER_VARS["HTTP_USER_AGENT"] (or $HTTP_USER_AGENT, if you have
> register_globals set to On).
> :
> : getenv() only works with the low-level environment, and $HTTP_USER_AGENT
> is not a part of it.
> :
>
> Zeev,
>
> 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.
Zeev
--
Zeev Suraski <zeev@zend.com>
http://www.zend.com/