This is a very simple code and works for anybody who is behind proxies and people who are not. This might
be usfull if your have cable users visiting your site.
| <?php $ip = getenv('REMOTE_HOST');
if(!$ip) { $ip = getenv('HTTP_X_FORWARDED_FOR'); } if(!$ip) { $ip = $HTTP_X_FORWARDED_FOR; } if(!$ip) { $ip = getenv('REMOTE_ADDR'); } if(!$ip) { $ip = $REMOTE_ADDR; } $ip = @GetHostByAddr($ip); echo $ip; ?> |





