Hi! I've got a problem when I try to log the visitors IP address. I use the following: <? ...
$IP = getenv('REMOTE_ADDR');
... ?> but it's not properly working. It always records 127.0.0.1 What could be the problem? Thanks for any help, Tobi
Try using $IP = $REMOTE_ADDR instead. See if that makes a difference.
I'm afraid that didn't help. I also have a problem with the referer:
<? ... $IP = $REMOTE_ADDR; $Referer = $HTTP_REFERER; ... ?>
So what's wrong? Please help :-)
Thanks in advance, Tobi
This always works for me
<? //get IP $ip = $GLOBALS['REMOTE_ADDR']; $forwarder = $GLOBALS['HTTP_X_FORWARDED_FOR']; if (($forwarder != "")&&($forwarder != "unknown")) $ip = $forwarder; ?>