faqts : Computers : Programming : Languages : PHP

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

19 of 22 people (86%) answered Yes
Recently 9 of 10 people (90%) answered Yes

Entry

Why can't php 4 on my apache 2 server find the $HTTP_USER_AGENT variable (it says undefined)?

Feb 29th, 2008 09:44
dman, Jens Clasen, Eric Dingle, http://www.ttnr.org


You will probably have a PHP-version >= 4.2.0 where register_globals is
turned off by default. Therefor all predefined vars are not global any
longer but availlable using the so called "Superglobals".
In your case $HTTP_USER_AGENT can be found in $_SERVER as
$_SERVER["HTTP_USER_AGENT"]