Re: getenv & $REMOTE_ADDR
| From: | Lars Torben Wilson | Date: | Wed, 20 Feb 2002 21:03:13 +0000 |
| Subject: | Re: getenv & $REMOTE_ADDR | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-85597@lists.php.net to get a copy of this message | ||
On Wed, 2002-02-20 at 12:42, Steven Walker wrote:
> What is the difference between $_SERVER and getenv()? Why should one be
> more reliable/better than the other?
>
> > Better: avoid globals and use $_SERVER['REMOTE_ADDR'].
>
> Sorry, if I'm asking you to repeat yourself... the documentation doesn't
> relate the two.
>
> Steven J. Walker
> Walker Effects
> www.walkereffects.com
> steve@walkereffects.com
Sorry, I meant that $_SERVER is better than using register_globals=on,
not that it's better than getenv(). Anyway, getenv() just gets a
variable value from the environment, and $_SERVER contains a hash of
server variables.
--
Torben Wilson <torben@php.net>
http://www.thebuttlesschaps.com
http://www.hybrid17.com
http://www.inflatableeye.com
+1.604.709.0506