Ragazzi sto usando questo codice..
$myip = $_SERVER['REMOTE_ADDR'];
$tags = get_meta_tags(“http://www.geobytes.com/IpLocator.ht...txt&IpAddress=$myip”);
$citta = $tags['city']; // city name
ma se stampo $citta mi da valore vuoto...
Dove sbaglio?
Ragazzi sto usando questo codice..
$myip = $_SERVER['REMOTE_ADDR'];
$tags = get_meta_tags(“http://www.geobytes.com/IpLocator.ht...txt&IpAddress=$myip”);
$citta = $tags['city']; // city name
ma se stampo $citta mi da valore vuoto...
Dove sbaglio?
E come devo vedere e nel caso settarlo ad on?
Guarda l'output di phpinfo() se ti dice che e' off.
ho fatto un echo di phpinfo() e allow_url_fopen è On On
Strano. E non ricevi errori quando esegui lo script?
se fai un var_dump($tags), cosa ti dice?
Mi dice questo:
array(0) { }
La cosa bella è che fino a 2 minuti prima funziona... Poi dopo due minuti no.
Però sul sito dove prendo il servizio tramite link,
mi dice questo:
There is more info here, but basically you get the first 20 lookups per hour for free and then only pay 1 Mapbyte (@ 1 tenth of a cent) per look up after that. Click here to purchase 10,000 Mapbytes for $10 (Or click here to purchase via PayPal).
C'è un altro sito che permette di ricavare la citta' da un IP in modo gratuito?
Ah ecco, ti limitano loro...
Guarda in questo thread: http://forum.html.it/forum/showthrea...readid=1404859 , che abbiamo discusso recentemente della geolocalizzazione.
Ho visto nel treadh suggerito.
Ho scoperto che questo link
http://api.hostip.info/get_html.php?ip=151.1.244.200
Mi fa salvare un file php con la città dentro.
Country: PHILIPPINES (PH)
City: Davao
IP: 151.1.244.200
Ora io dovrei gestire questi dati in modo da prendere solo la Città evintando il salvataggio del file e voglio che questo dato (città) vada a finire in una mia variabile.
Come potrei fare?