ktalebian Posted July 12, 2007 Share Posted July 12, 2007 Hi, how do I get someone's IP? The code I have $ip=$_SERVER['REMOTE_ADDR']; does not give the computer IP! I want the computer IP, so that all IPs gathered would be different. Basically, I want the IP that the site www.whatismyip.com shows! thank you Link to comment https://forums.phpfreaks.com/topic/59551-ip/ Share on other sites More sharing options...
trq Posted July 12, 2007 Share Posted July 12, 2007 Probably about as reliable as you'll get. Ips should not however be relied upon in general. <?php $ip = $_SERVER['HTTP_X_FORWARDED_FOR'] ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; ?> Link to comment https://forums.phpfreaks.com/topic/59551-ip/#findComment-295921 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.