HELP! Trying to use php to identify the city a user is in

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

User avatar
Bill H
DevNet Resident
Posts: 1136
Joined: Sat Jun 01, 2002 10:16 am
Location: San Diego CA
Contact:

Post by Bill H »

It put me in Atlanta GA, which is pretty cool actually.

I now live in San Diego CA, but I did live in Atlanta for almost 15 years (about 20 years ago).
I love that city, and if I didn't live here I would want to be there.
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

It still says the wrong location, but it is indeed neat.

It might be possible to combine this script with another data source that could list all cities and their lat/long so you could work on user inputted data instead of IP address data.

I think that's what I will do. :)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

yeah, geographic data via IP isn't reliable with the megaISPs around these days.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

There are some cool demos that work with user inputted data, fe: http://maps.smugmug.com/.
phatass
Forum Newbie
Posts: 1
Joined: Sat Aug 27, 2005 10:47 pm

User entered data

Post by phatass »

IP geocoding doesn't really work these days.

With user entered data there are ways of doing this.

It's not hard to implement a zip code lookup.

phat
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

I think we all agree that user entered data is usually more reliable.

There is a reason/case why people choose for an IP<->Location mapping though, because it's usually impossible to know where the user is coming from. In this case it can be useful, eg: if you want to show different banners for different countries.. I don't expect you ask a surfer to tell his location before you send him an appropriate banner ;)
tony007
Forum Newbie
Posts: 1
Joined: Thu Apr 06, 2006 10:40 pm

Post by tony007 »

Hi all. could any one post the needed files to install this script. I only got the .dat file. I be happy if an expert tell me how to install it.Thanks
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

All you need now is:
- an image of the world
- http://www.maxmind.com/download/geoip/a ... ipcity.inc
Post Reply