zipperdeaf Posted February 13, 2007 Share Posted February 13, 2007 Is there a way, and if so how would I detect the state of the user on my site. Like by using their ip? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/38314-php-ip-lookup-and-detect-state/ Share on other sites More sharing options...
trq Posted February 13, 2007 Share Posted February 13, 2007 What do you mean by state? Like provence? Where not all in the US ya know? Quote Link to comment https://forums.phpfreaks.com/topic/38314-php-ip-lookup-and-detect-state/#findComment-183619 Share on other sites More sharing options...
thedark Posted February 13, 2007 Share Posted February 13, 2007 You can use tool at http://www.ipgp.net . Enter the IP and you will get country, state, city, and also you will see a map with the location of the IP. Quote Link to comment https://forums.phpfreaks.com/topic/38314-php-ip-lookup-and-detect-state/#findComment-183759 Share on other sites More sharing options...
zipperdeaf Posted February 14, 2007 Author Share Posted February 14, 2007 Is there a way to do this within the php itself, ie- i want to have an image change on the page if they are from a certain area. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/38314-php-ip-lookup-and-detect-state/#findComment-184971 Share on other sites More sharing options...
zq29 Posted February 14, 2007 Share Posted February 14, 2007 You'll need to use a geolocation / geocoding service, these are generally not free. Search for either term on Google to return some services. [NOTE: Other search engines are available] Quote Link to comment https://forums.phpfreaks.com/topic/38314-php-ip-lookup-and-detect-state/#findComment-184983 Share on other sites More sharing options...
zipperdeaf Posted February 15, 2007 Author Share Posted February 15, 2007 Thanks! I found that google maps has an api service for something like this but im still trying to find a way to still detect the location through ip. any suggestions? Quote Link to comment https://forums.phpfreaks.com/topic/38314-php-ip-lookup-and-detect-state/#findComment-185409 Share on other sites More sharing options...
trq Posted February 15, 2007 Share Posted February 15, 2007 Whats wrong with the suggestions already posted? Quote Link to comment https://forums.phpfreaks.com/topic/38314-php-ip-lookup-and-detect-state/#findComment-185416 Share on other sites More sharing options...
SharkBait Posted February 15, 2007 Share Posted February 15, 2007 There is also the IP2Country database. usually in the form of a text file that you can parse through and figure out where someone is based on a algorithim of their IP. Just google for IP2Country and there should be examples of that too, else I can find the script I use. Quote Link to comment https://forums.phpfreaks.com/topic/38314-php-ip-lookup-and-detect-state/#findComment-185425 Share on other sites More sharing options...
zipperdeaf Posted February 15, 2007 Author Share Posted February 15, 2007 I need to get down to the state though this is mainly to detect if someone is a Florida resident Quote Link to comment https://forums.phpfreaks.com/topic/38314-php-ip-lookup-and-detect-state/#findComment-185697 Share on other sites More sharing options...
beermaker74 Posted February 16, 2007 Share Posted February 16, 2007 check out http://www.maxmind.com/ they have a free version of their service that you can put in a mysql database to lookup the ip. the free service is updated once a month. I am about to do the same thing for my site so i can show info customized for their state Quote Link to comment https://forums.phpfreaks.com/topic/38314-php-ip-lookup-and-detect-state/#findComment-186080 Share on other sites More sharing options...
zipperdeaf Posted February 19, 2007 Author Share Posted February 19, 2007 Thanks. I got it! I found a really good script using only a few lines of javascript for anyone else interested - http://www.geobytes.com/GeoDirection.htm Quote Link to comment https://forums.phpfreaks.com/topic/38314-php-ip-lookup-and-detect-state/#findComment-189065 Share on other sites More sharing options...
Greaser9780 Posted February 19, 2007 Share Posted February 19, 2007 Thanks for the heads up. That'll come in handy. Quote Link to comment https://forums.phpfreaks.com/topic/38314-php-ip-lookup-and-detect-state/#findComment-189074 Share on other sites More sharing options...
beermaker74 Posted February 21, 2007 Share Posted February 21, 2007 thanks for the link. much easier than the custom database solution. I dont know what I would do without the great online communities here. damn i saw that they pop up an ad. or you can pay 10 a month for 10000 requests. Guess I will be using the maxmind solution. Has anybody here used it? Quote Link to comment https://forums.phpfreaks.com/topic/38314-php-ip-lookup-and-detect-state/#findComment-190013 Share on other sites More sharing options...
thedark Posted May 3, 2011 Share Posted May 3, 2011 Maxmind database is the most up-to-date ip database. What is more important is that they are not using mysql to store the results. This is great because querying the mysql database so many times will slow down your request rate. Also dealing with so heavy databases is hard. With maxmind you have only to download a file and include a file which contains classes to get the data. Quote Link to comment https://forums.phpfreaks.com/topic/38314-php-ip-lookup-and-detect-state/#findComment-1209758 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.