freakedout Posted February 14, 2008 Share Posted February 14, 2008 Hello All, i have got the ip addresses of visitors of my website by using $_SERVER['REMOTE_ADDR']; But i need to find the exact location of these ip addresses. Is this possible using php? Any suggestions. Thanks.. Quote Link to comment https://forums.phpfreaks.com/topic/91053-ip-address/ Share on other sites More sharing options...
PHP Monkeh Posted February 14, 2008 Share Posted February 14, 2008 I just did a google search and this site looks quite interesting: http://www.hostip.info/use.html You could use this method: http://api.hostip.info/get_html.php?ip=12.215.42.19 Which outputs the Country to the browser (I haven't tested it with another IP yet) so you get use file_get_contents() and read the first line Quote Link to comment https://forums.phpfreaks.com/topic/91053-ip-address/#findComment-466667 Share on other sites More sharing options...
laffin Posted February 14, 2008 Share Posted February 14, 2008 there also is a class called geoip. T Quote Link to comment https://forums.phpfreaks.com/topic/91053-ip-address/#findComment-466669 Share on other sites More sharing options...
GameYin Posted February 14, 2008 Share Posted February 14, 2008 Wait, I'm still learning everything about php, can you locate someone more specifically then their country? Quote Link to comment https://forums.phpfreaks.com/topic/91053-ip-address/#findComment-466680 Share on other sites More sharing options...
PHP Monkeh Posted February 14, 2008 Share Posted February 14, 2008 The website link I gave output a City, and the GeoIP class looks like it can output a city also http://us3.php.net/manual/en/function.geoip-record-by-name.php Quote Link to comment https://forums.phpfreaks.com/topic/91053-ip-address/#findComment-466858 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.