[OSGeo-Discuss] geo ip locator services

Stephen Woodbridge woodbri at swoodbridge.com
Fri Feb 15 05:53:27 PST 2013


On 2/15/2013 6:33 AM, Rashad M wrote:
> Is there any Free GeoIp locator services available that can get info
> without any limit by ip/country?
>
> If no Is it possible to build a custom geoip locator?

You can install geoip on most linux systems. I built a ws using this code:

<?php
header("Content-type: text/plain");
$ip = $_REQUEST[ip];
$r = geoip_record_by_name($ip);
$r['ip_address'] = $ip;
$json = json_encode($r);
$json = preg_replace('/^([^[{].*)$/', '[$1]', $json);
echo "geoip: ", $json, "\n";
#print_r($r);
?>


-Steve W




More information about the Discuss mailing list