I use the following code to get a clients ip that comes to my webpage.
<php
if (getenv(HTTP_X_FORWARDED_FOR)) {
$ip = getenv('HTTP_X_FORWARD_FOR');
$host = gethostbyaddr($ip);
} else {
$ip = getenv('REMOTE_ADDR');
$host = gethostbyaddr($ip);
}
?>
The first part makes sure I don't get the IP of the ISP Cache Server. Now this code works fine.... unless someone is behind a router or firewall, then it just returns blank.
I want code that will get the ip no matter what. Maybe that first part is messing it up. I've seen clients written in other languages that can get the ip no matter what....like if you were behind a firewall your ip would show up as 24.209.14.35/192.168.0.1 or something...that would be sweet.
thanks boyz