I am trying to get the user's ip when they visit my site by using :
$IP = getenv('REMOTE_ADDR');
but I keep getting the ip of the website everytime, no matter who hits the site.
does anyone know why???
hmmm... seems funky. Maybe try not using getenv(). <? echo $GLOBALS['REMOTE_ADDR']; echo $_SERVER['REMOTE_ADDR']; ?>
plink
Personally I think it has more to do with the fact that REMOTE_ADDR is designed to give the IP;
RT(F)M:
'REMOTE_ADDR' The IP address from which the user is viewing the current page.
A forum, a FAQ, email notification, what else do you need?
But the IP of the site?
I tried both $GLOBALS and $_SERVER
$GLOBALS returned the website ip again and $_SERVER didn't return anything...
Could their be a php setting that is defaulting to this for some reason?