timmah1 Posted May 3, 2009 Share Posted May 3, 2009 I have looked everywhere to be able to grab a visitors information based on their IP Address. I know these show me basic information <?php $ip = $_SERVER['REMOTE_ADDR']; $hostaddress = gethostbyaddr($ip); $browser = $_SERVER['HTTP_USER_AGENT']; $referred = $_SERVER['HTTP_REFERER']; ?> But I would like to be able to show the users country, and even better yet, their city, state and zip code. Unfortunately, the only thing that I am able to find, cost hundreds of dollars. Does anybody know of anywhere, or how I could, display the users country, state, city and zip code from their IP address? Any help would be greatly appreciated. Thanks in advance Link to comment https://forums.phpfreaks.com/topic/156704-solved-ip-information/ Share on other sites More sharing options...
the182guy Posted May 3, 2009 Share Posted May 3, 2009 You won't be able to get the zip code. Those websites that use these GeoIP systems are often very inaccurate, they nearly always get the city wrong and often get the country wrong. Don't rely on the data they provide in any way. For example... Paypal.com, everytime I visit this website their GeoIP scripts try to determine my county, they get it wrong everytime. I am in England, yet the site always thinks I am in the Netherlands and thus produces all the text in the Dutch language which is annoying. That shows that even a big corporation like Paypal can't even do it accurately. Here is some info anyway http://uk.php.net/manual/en/intro.geoip.php Link to comment https://forums.phpfreaks.com/topic/156704-solved-ip-information/#findComment-825169 Share on other sites More sharing options...
timmah1 Posted May 3, 2009 Author Share Posted May 3, 2009 Thank you for the information. I understand about inaccuracies, some sites say I'm in the UK, some say US, I'm in the US, but none so far has showed the correct state, always either New York or Washington, two separate sides of the country. Thank you Link to comment https://forums.phpfreaks.com/topic/156704-solved-ip-information/#findComment-825171 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.