3

Possible Duplicate:
is there a good PHP geolocation service?

Is it possible to determine which state a visitor to a web page is from based on their IP address? I know you can get this data (and relative location data) from searching their IP addresses using the various WHOIS tools out there, but I'm not sure how I would achieve this on a single web page. I want to display some contextual information to visors on my site.

Community
  • 1
  • 1
bccarlso
  • 187
  • 3
  • 10
  • see also [How to do a geoip lookup in php?](http://stackoverflow.com/questions/6499145/how-to-do-a-geoip-lookup-in-php/) – Steve Robbins Jun 28 '11 at 17:36

2 Answers2

3

You can install the GeoIP extension.

Alex Howansky
  • 50,515
  • 8
  • 78
  • 98
1

You can use Maxmind's PHP API for Geo IP lookup with their GeoLiteCity free database.

anubhava
  • 761,203
  • 64
  • 569
  • 643