Re: php tutorial
| From: | Gabor Hojtsy | Date: | Fri, 01 Mar 2002 10:45:22 +0000 |
| Subject: | Re: php tutorial | ||
| References: | 1 | Groups: | php.mirrors |
| Request: | Send a blank email to php-mirrors+get-8898@lists.php.net to get a copy of this message | ||
> I just upgraded to PHP 4.1.2, and now a lot of my pages dont work. I
went
> to the intro tutorial, and the code there doesnt work either. Is there
> something I have to turn on now? I need help getting this to work:
>
> <?php echo $HTTP_USER_AGENT; ?>
>
> How do the vars get requested now? I need to use the environment var.
That tutorial implies, that you have the old type of PHP installation.
In newer versions of PHP, we recommend you using register_globals = Off
in php.ini, to eg. write more secure programs. This setting affects
the global variable you mentioned above.
From PHP 4.0.3, track_vars is allways turned on, so you can access
this var with $HTTP_ENV_VARS['HTTP_USER_AGENT']. From PHP 4.1.0,
the $_ENV['HTTP_USER_AGENT'] alternative is also here for you to
choose. At last, you can use getenv('HTTP_USER_AGENT') to get the
environmental variables.
Note, that this address is not for submitting such support questions.
Please ask further questions on our mailing lists, or other support
channels. A list can be found at http://php.net/support
Goba [one webmaster@php.net]