Jun 18, 2004 #2 DRJ478 IS-IT--Management Aug 10, 2001 2,264 US Usually: $_SERVER['REMOTE_ADDR'] However, there could be X_FORWARDED_FOR values etc. for proxied requests. IP is not telling you much - also remember that IPv4 is not spoof-proof. Upvote 0 Downvote
Usually: $_SERVER['REMOTE_ADDR'] However, there could be X_FORWARDED_FOR values etc. for proxied requests. IP is not telling you much - also remember that IPv4 is not spoof-proof.
Jun 18, 2004 1 #3 iranor Programmer Jun 17, 2004 174 CA If you want the IP and Host : if (getenv("HTTP_X_FORWARDED_FOR")){ $ip=getenv("HTTP_X_FORWARDED_FOR"); } else { $ip=getenv("REMOTE_ADDR"); } $hostname = gethostbyaddr($ip); Here , $hostname : display user's hostname $ip : display user's ip Upvote 0 Downvote
If you want the IP and Host : if (getenv("HTTP_X_FORWARDED_FOR")){ $ip=getenv("HTTP_X_FORWARDED_FOR"); } else { $ip=getenv("REMOTE_ADDR"); } $hostname = gethostbyaddr($ip); Here , $hostname : display user's hostname $ip : display user's ip
Jun 18, 2004 Thread starter #4 rbauerle Programmer Oct 16, 2001 48 BR that was very, very usefull. Tks again Upvote 0 Downvote