Forum Moderators: coopster
This is in my php info script
PHP Version 4.3.0RC2
Windows NT localhost 5.0 build 2195
register_globals = on (am trying to code as if it's off as recommended)
_SERVER["HTTP_USER_AGENT"] equals Mozilla/4.0 (compatible; MSIE 5.22; Mac_PowerPC)
using iis on windows 2000
This is some of the stuff i've tried, i also have tried the deprecated versions that are no longer used, but it does no better.
$request = $_Server[PHP_SELF];
$host = $_Server['SERVER_NAME'];
$address = $_SERVER[REQUEST_URI];
$agent = {$_SERVER['HTTP_USER_AGENT']};
$agent = $_SERVER["HTTP_USER_AGENT"];
$agent = $HTTP_USER_AGENT;
How should i refer to these variables. Is there IIS specific syntax or something new to 4.3. Is it a bug in 4.3 that i am using. I want it to work with globals turned off.
I used phpinfo() to list all variables
then i copied the server variables section and put $ in front of each one. I left the values as comments as a future reference. Now at least i know exactly what all my variables are.
it seems that $_server variables are not of global scope no matter what the manual says, i was trying to access them in a function i am setting up for logging. Now i have a bunch of define() constructs so i can access this stuff from inside anything without a bunch of fuss.
$agent = $_SERVER["HTTP_USER_AGENT"];
was the working line, which definitely does not work in a function.
Is this how it is on the unix, linux side as well or is this just an iis quirk.
Another hurdle in learning php overcome, on to the next hill