Page 1 of 1

Something simple

Posted: Fri Mar 05, 2004 2:27 pm
by ol4pr0

Code: Select all

$ip = $REMOTE_ADDR;
$host = $REMOTE_HOST;

$message =  "ip: $ip Host: $host ";
problem:
Notice: Undefined variable: REMOTE_HOST
Anybody got the fix ?

Posted: Fri Mar 05, 2004 3:15 pm
by ol4pr0

Code: Select all

$_ENV['remote_host'];
fixed my problem ;-)

Posted: Mon Mar 08, 2004 4:30 am
by twigletmac
You could also use the $_SERVER array, which is where most of those variables are since PHP 4.1 (it's a register_globals thing) - $_SERVER['REMOTE_HOST'] and $_SERVER['REMOTE_ADDR'].

Mac