Anyone know where you can get data to use in a PHP script for location the geographical location of a user's IP Address, including city and state, country, etc. I know of Arin and that is about it, any ideas?
Thanks in advance!
http://www.ip2location.com/ has some good databases, but at the current time city is not going to be very accurate. it may be close in most instances however.
They have the database I think you are looking for...
http://ip-to-country.webhosting.info/
how about this?
$ipaddr = "211.115.69.146"; $field = "City"; $data = exec("whois -h whois.arin.net \"+ $ipaddr\"",$ret); foreach($ret as $line) { $search = strstr($line,$field); if($search != "") { $searchx = explode(":",$search); echo trim($searchx[1]); } }