Re: [PHP] Re: $ENV{'REMOTE_ADDR'}

2001-11-19 Thread Danijel Tasov

Hello,

On Wed, Oct 31, 2001 at 03:26:44PM -0500, Liz Fulghum wrote:
 if ($REMOTE_ADDR==127.0.0.1) {
 do something
 } elseif ($REMOTE_ADDR==remote.somewhere.com) {
 do something else
 } else {
 eeks! its the end
 }

But how to easily accessing the whole environment. For example,
can you port this to PHP?

  print map { $_=$ENV{$_}\n } sort keys %ENV;

bye,
Da.Ta.

-- 
ooo   oo   o oo   |  Danijel Tasov, [EMAIL PROTECTED]
o  o o  oo  o  o  |  00 3A 65 0C 47 66 46 27  E2 AF 3A C4 1C 2E E8 EE
o  o o    |  http://www.camelot.de/news/
ooo  o  o.   o  o  o. |  # fortune: No such file or directory



msg40507/pgp0.pgp
Description: PGP signature


[PHP] Re: $ENV{'REMOTE_ADDR'}

2001-10-31 Thread Liz Fulghum

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 [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 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




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]