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 Quote Link to comment 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']; ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.