Re: Environment extract
| From: | Costas | Date: | Tue, 27 Mar 2001 16:31:25 +0000 |
| Subject: | Re: Environment extract | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-45736@lists.php.net to get a copy of this message | ||
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"" <matt@daart.ca> wrote in message
news:002701c0b6d8$88abb740$03284d18@mattq3h8budilr...
> 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.
> http://www.php.net/
>
> Also, write a short script and run it as so:
> <? phpinfo(); ?>
> You'll see a myriad of variables and their values. It's also handy for
> debugging. You can include phpinfo() anywhere to see the output values of
> your script.
>
> Matt Friedman
>
>
>
> ----- Original Message -----
> From: "Costas" <costas@othermedia.com>
> To: <php-general@lists.php.net>
> Sent: Tuesday, March 27, 2001 8:01 AM
> Subject: [PHP] Environment extract
>
>
> > In perl the code to extract browser info is:
> > $length = $ENV{'HTTP_USER_AGENT'};
> >
> > What is the equivalent code in PHP.
> >
> > Thanks
> >
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
> >
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>