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 }