October 29, 2008 at 6:40 pm
#784618
Inactive
First of all you’ll need a database of IP addresses and then there are usually examples of its usage (including PHP) on corresponding sites.
You can get such db for free (without state info) here: http://ip-to-country.webhosting.info/node/view/9 or here: http://www.ip2nation.com/. I personally prefer ip-to-country because it’s updated more regularly and it’s bigger;
Or paid (with state info and so on) here: http://www.ip2location.com/free.asp (didn’t tried it myself).