czesc,
Czy ktos moze polecic API lub kod jak zrobic mapowanie z IP na panstwo+miasto?
znalazlem cos takiego ale nie dziala:
Grab the users IP address.
$ip = $_SERVER['REMOTE_ADDR'];
Get the users City, State and Country.
$sturl = 'http://api.hostip.info/get_html.php?ip='.$ip;
$ch = curl_init($sturl);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch,CURLOPT_TIMEOUT,10);
$res = curl_exec($ch);
$resinfo = curl_getinfo($ch);
curl_close($ch);
preg_match('/City: ([a-zA-Z].+[a-zA-Z]+)/', $res, $r);
preg_match('/ (([A-Z][A-Z])/', $res, $s);
$city = $r[1];
$country = $s[1];
z: http://www.scriptiny.com/2008/04/map-your-...ps-api-and-php/
dzieki,
Robert