English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I want to use a clients IP address to find where they are requesting from so that I can dynamically arrange page content to make it easier to find what they want and push less important stuff out of focus. Im sure you've seen something similar before.
Right now I have a PHP script that I wrote which captures the IP and stores it into a variable named "ipAddr". I can explode it into octects or keep it as a 32 bit value. And if needed i can write it to a .txt file, but I dont want to do this because I have no use for the file once the user leaves.
What IM looking to find out is what do I do with this variable to get geo info from it? Im aware of services that do this for a fee or do it if you type in every IP into a text field on their site.... but I need to be able to send out just the "ipAddr" variable and get beack just the [ city, state, zip, latitude, longitude ] . If I can get that info into a javascript variable (thru server or direct from source) then I'll be golden .

2007-02-14 18:19:46 · 2 answers · asked by bonesawosu 2 in Computers & Internet Programming & Design

2 answers

Check out MaxMind GeoIP:

http://www.maxmind.com/app/ip-location

2007-02-17 17:56:28 · answer #1 · answered by NC 7 · 0 0

An IP address contains no information to map it to a geographic location. You are going to have to use one of those services that does this for you if you want this functionality. I believe they are expensive too....

2007-02-15 10:21:56 · answer #2 · answered by Pfo 7 · 0 0

fedest.com, questions and answers