Page 1 of 1

problem with $REMOTE_ADDR

Posted: Tue Mar 18, 2003 12:20 pm
by mzfp2
I guys

im having a problem with what the $REMOTE_ADDR variable returns, in some parts of my script it returns the IP address of my machine, but in other parts it returns nothing?

in the routines that uses it, ive tried making it global, and even identified it as global at the start of the script, but it seems in some functions it has a value, and some it doesnt

its very unpredictable, and only occurs when i upload the script to the unix server

Posted: Tue Mar 18, 2003 1:26 pm
by rodrigocaldeira
use $_SERVER['REMOTE_ADDR']

Posted: Wed Mar 19, 2003 1:57 am
by twigletmac
Using $_SERVER['REMOTE_ADDR'] means that you don't have to worry about declaring it global because the $_SERVER array is an autoglobal.

Mac