<?php
$ziyaretci_ip = $_SERVER['REMOTE_ADDR'];
$adres = 'http://www.geoplugin.net/php.gp?ip='.$ziyaretci_ip;
$curl = curl_init($adres);
$a = curl_exec($curl);
$b = explode("geoplugin_countryCode", $a);
$c = explode(":", $b[1]);
$d = explode(";", $c[2]);
$ulkekod = str_replace("\"", "", $d[0]);
echo $ulkekod;
if ($ulkekod == "TR")
{
echo 'Türkiye';
}
elseif ($ulkekod == "IT")
{
echo 'İtalya';
}
elseif ($ulkekod == "SE")
{
echo 'İsveç';
}
else
{
echo 'Hiçbirisi';
}
?>Bu olur mu?
bu şekilde olmadı hocam bende denemiştim.
Alıntı
a:16:{s:17:"geoplugin_request";s:13:"176.90.23.132 ";s:16:"geoplugin_status";i:200;s:14:"geoplugin_ci ty";s:6:"Ankara";s:16:"geoplugin_region";s:15:"Ank ara Province";s:18:"geoplugin_areaCode";s:1:"0";s:17:" geoplugin_dmaCode";s:1:"0";s:21:"geoplugin_country Code";s:2:"TR";s:21:"geoplugin_countryName";s:6:"T urkey";s:23:"geoplugin_continentCode";s:2:"AS";s:1 8:"geoplugin_latitude";s:15:"39.911701202393";s:19 :"geoplugin_longitude";s:15:"32.840301513672";s:20 :"geoplugin_regionCode";s:2:"68";s:20:"geoplugin_r egionName";s:15:"Ankara Province";s:22:"geoplugin_currencyCode";s:3:"TRL"; s:24:"geoplugin_currencySymbol";s:7:"₤";s:27:"geop lugin_currencyConverter";N;}Hiçbirisi
böyle bi çıktısı oluyo