Re: $ENV{'REMOTE_ADDR'}
| From: | Liz Fulghum | Date: | Wed, 31 Oct 2001 20:26:44 +0000 |
| Subject: | Re: $ENV{'REMOTE_ADDR'} | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-73067@lists.php.net to get a copy of this message | ||
if ($REMOTE_ADDR=="127.0.0.1") {
do something
} elseif ($REMOTE_ADDR=="remote.somewhere.com") {
do something else
} else {
eeks! its the end
}
List of all the predefined variables:
http://www.php.net/manual/en/language.variables.predefined.php
--
Liz Fulghum
--------------------------------------------------------------
http://www.lipstickalley.com/ - Be Popular!
Want to learn PHP?
http://webdeveloper.earthweb.com/scripting/article/0,,12014_900521,00.html
--------------------------------------------------------------
"Jtjohnston" <jtjohnston@courrier.usherb.ca> wrote in message
news:3BE059ED.5F349B8B@courrier.usherb.ca...
> In perl I do something like this:
>
> if (!($ENV{'REMOTE_ADDR'} =~ /\b(132\.210)/))
> or
> ... $ENV{'REMOTE_HOST'}
>
> PHP is not Perl. So how do I parse the user's remote address or host to
> display one thing if IP = 127.0.0.1, another if = 209.247.2.3 another if
> host = "remote.somewhere.com" else echo Blah";
>
> John
>