How to automatically detect a user's location (city, country)?

Does anybody know if there are any tools/scripts to use for detecting a user’s city & country automatically?

I’m NOT referring to that normal Javascript tag- the one that ‘detects’ your location and asks you to confirm it via pop-up.

Thanks!

IP2Location will provide a database of IP’s you can cross reference.
As a starting point I added the code for the class I use here

It depends how accurate you need to be. My IP address will give my location as London (my ISP’s location), which is out by about 400 miles and in the wrong country.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.