Jump to content

[SOLVED] IP Information


timmah1

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.