I need a consistent and reliable way to determine the location (state/province, country, etc) of a computer that visits my website, using any of the following:
- PHP
- JavaScript
- MySQL
- Any Web Services
- Something I haven't thought of?
I'm am not looking for a locked-out 3rd party stats program such as Google Analytics. It's already in use and does amazing stuff, however I need code level access to the information.
The ideal solution should allow me to provide whatever information is required (such as an ip address) and accurately obtain as much information as I can about the visit. Obtaining the country of origin is a minimum requirement however extras such as states, latitude and longitude, city, etc would be nice.
Clarification: I need to be able to use the information regularly in PHP code. Not just view it somewhere.