Ahh, that's the cause. Here's how to duplicate the error :-)
error_reporting(E_NOTICE);
foo();
function foo()
{
echo $HTTP_USER_AGENT;
}
As Mark mentioned, mind your scope. Regarding the error, I just posted
some information on this perhaps it'll be of some use :
http://mar
On Tue, 27 Mar 2001 17:31:25 +0100, Costas ([EMAIL PROTECTED])
wrote:
>when i try printing
>
>print $HTTP_USER_AGENT;
>
>I get the error message Undefined variable: HTTP_USER_AGENT
>
>have i missed a declaration of some sort or something else?
>
>thanks
Are you doing this from inside a function
when i try printing
print $HTTP_USER_AGENT;
I get the error message Undefined variable: HTTP_USER_AGENT
have i missed a declaration of some sort or something else?
thanks
""Matt Friedman"" <[EMAIL PROTECTED]> wrote in message
002701c0b6d8$88abb740$03284d18@mattq3h8budilr">news:002701c0b6d8$8
print $HTTP_USER_AGENT; // the variable is already in the global scope.
also $ua = getenv('HTTP_USER_AGENT');
Most variables are automatically made a part of the environment in a PHP
script. It's one of the ways PHP makes scripting easier.
The online manual is invaluable for this type of info.
4 matches
Mail list logo