Discussion in 'OT Technology' started by intrktevo, Oct 19, 2008.
What's the best method for php, to get the user's state based on their IP?
Just did a quick search on google and found this. I did some quick tests by appending my IP address to the end of the URL and it did match my city. It will be more accurate if the person is in a larger city versus a smaller one. But it includes a php function to return the location. There may be a better way out there, this is just the first that I found.
it says im from australia
use one of the geokit apis out there. let me see if i can dig up some more info
it might be easier just to read a cookie or saved form data where they probably entered their zip code or state or another web site
I always thought that was how web advertisements targeted specific locations.. or is that done by IP?
i was looking at http://www.maxmind.com/app/php but it seems like a lot of stuff just to get the users state. i would of thought there was some easy solution.
the link sharp posted looking promising but I keep getting a permission denied error when i try to integrate it
no idea, but i'd be interested in finding out
1) Use the GeoIP.php class from here.
2) Get the Data file from here.
Best way. Once its installed, its a single line of code to get any data you want from an IP.