Total Users Online: 0 üye, 221 guest | Tarih/Saat: 2026-09-22 11:09
 
Php Ülke ve şehir bulma
2010-10-01 20:49 GMT  oklu Alnt
Kaan

User is: Online status   Gender_M
Posts: 2772
Ülke: İstanbul - 34
Meslek: Serbest Meslek
Age: 43

Php ?lke ve ?ehir bulma
?zellikle bizim ?lkede ?ehir tutturmak ?ok ?ok zor b?lge bile zor tutuyor..
Bu nedenle do?ru verileri alamayabilirsiniz..


Bu ?zelli?i Seditio da Kullanabilirsiniz.
Kullanmak isterseniz Bildiriniz nas?l yap?laca??n? anlat?r?m.


:
hp]<?

function locateIp($ip){

    $d = file_get_contents("http://www.ipinfodb.com/ip_query.php?ip=$ip&output=xml");

 

    //Use backup server if cannot make a connection

    if (!$d){

        $backup = file_get_contents("http://backup.ipinfodb.com/ip_query.php?ip=$ip&output=xml");

        $answer = new SimpleXMLElement($backup);

        if (!$backup) return false; // Failed to open connection

    }else{

        $answer = new SimpleXMLElement($d);

    }

 

    $country_code = $answer->CountryCode;

    $country_name = $answer->CountryName;

    $region_name = $answer->RegionName;

    $city = $answer->City;

    $zippostalcode = $answer->ZipPostalCode;

    $latitude = $answer->Latitude;

    $longitude = $answer->Longitude;

    $timezone = $answer->Timezone;

    $gmtoffset = $answer->Gmtoffset;

    $dstoffset = $answer->Dstoffset;

 

    //Return the data as an array

    return array('ip' => $ip, 'country_code' => $country_code, 'country_name' => $country_name, 'region_name' => $region_name, 'city' => $city, 'zippostalcode' => $zippostalcode, 'latitude' => $latitude, 'longitude' => $longitude, 'timezone' => $timezone, 'gmtoffset' => $gmtoffset, 'dstoffset' => $dstoffset);

}

 

//Usage example

$ip = "$_SERVER[REMOTE_ADDR]";

$ip_data = locateIp($ip);

 

echo "IP adresi : " . $ip_data['ip'] . "<br>";

echo "?lke : " . $ip_data['country_name'] . "<br>";

echo "?ehir : " . $ip_data['city'] . "<br>";

?>


son mesaj 3 dakika ?nce

Ayr?ca Di?er ?zellikleride ekleyebilirsiniz.

Kod:
$country_code = $answer->CountryCode; TR
    $country_name = $answer->CountryName; ?lke
    $region_name = $answer->RegionName; bilmiyorum
    $city = $answer->City; ?ehir
    $zippostalcode = $answer->ZipPostalCode; zip kodu
    $latitude = $answer->Latitude;
    $longitude = $answer->Longitude;
    $timezone = $answer->Timezone;
    $gmtoffset = $answer->Gmtoffset;
    $dstoffset = $answer->Dstoffset;


Test etmek i?in ziyaret edin: http://backup.ipinfodb.com/
Konuyla İlgili Diğer Başlıklar
Seditio Şehir, İlçe, Semt, Mahalle Entegresi
Firefox'u en çok hangi ülke indirdi?
Ülke resimleri , son üyeler gün?

Bu mesaj Kaan tarafından 2010-10-01 20:53 GMT, 5834 Gün önce düzenlendi.
Emlak, Oto Galeri, Rent A Car, ?iir, Edebiyat Script Sipari?lerinizi Verebilirsiniz.
Detaylar ??in: kaan@ntka.org

Seditio 170 ?ndir
Capte M?zik ?ndir
Seditio Toolbar ?ndir

 

Powered by Seditio © 2009-2012 All Rights Reserved