• 12-04-2018, 18:08:42
    #1
    Htaccess ile değilde php ile mesela tüm avrupa ülkelerini engellemek istiyorum, bunun scripti var mıdır? (wordpress değildir site)
  • 12-04-2018, 18:11:51
    #2
    Flexible adlı üyeden alıntı: mesajı görüntüle
    Htaccess ile değilde php ile mesela tüm avrupa ülkelerini engellemek istiyorum, bunun scripti var mıdır? (wordpress değildir site)
    //Get user IP address $ip=$_SERVER['REMOTE_ADDR']; //Using the API to get information about this IP $details = json_decode(file_get_contents("http://www.geoplugin.net/json.gp?ip=$ip")); //Using the geoplugin to get the continent for this IP $continent=$details->geoplugin_continentCode; //And for the country $country=$details->geoplugin_countryCode; //If continent is Europe if($continent==="EU" && $country==="UK" || $continent!="EU"){ //Do action if country is UK or not from Europe}else{ //Do action if country is in Europe , but its not UK }
  • 12-04-2018, 18:13:14
    #3
    =ip2long("76.105.99.0");$mask=ip2long("255.255.255.0");$remote=ip2long($_SERVER['REMOTE_ADDR']);if(($remote & $mask)==$network){ header("Location: http://example.com");exit;}



    ip aralığı engelletin.