Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
<?
$ipadres = $_SERVER['REMOTE_ADDR'];
$country = GetCountry($ipadres);
function GetCountry($ipadres) {
if ( $file = fopen("ip-to-country.csv","r") ) {
while ( $line = fgetcsv($file,1024,",") ) {
// $line[2] = country code 2 char,
// $line[3] = country code 3 char, if needed...
if ( ip2long($ipadres) >= $line[0] && ip2long($ipadres) <= $line[1] ) {
return $line[4];
}
}
}
return false;
}
if($country != "BULGARIA") { exit; }
?>
<?
$ipadres = $_SERVER['REMOTE_ADDR'];
$country = GetCountry($ipadres);
$useragent = $_SERVER["HTTP_USER_AGENT"];
$googlebot = strpos($useragent, "Googlebot");
function GetCountry($ipadres) {
if ( $file = fopen("ip-to-country.csv","r") ) {
while ( $line = fgetcsv($file,1024,",") ) {
// $line[2] = country code 2 char,
// $line[3] = country code 3 char, if needed...
if ( ip2long($ipadres) >= $line[0] && ip2long($ipadres) <= $line[1] ) {
return $line[4];
}
}
}
return false;
}
if(($country != "BULGARIA") && ($googlebot == false)) {
echo "<h2>Access Denied!</h2>";
exit;
}
?>
<?
$ipadres = $_SERVER['REMOTE_ADDR'];
$country = GetCountry($ipadres);
$agent = $_SERVER["HTTP_USER_AGENT"];
$botlist = array("Google","Yandex","msnbot","Yahoo");
foreach($botlist as $bot) {
if(ereg($bot, $agent)) { $isbot = "YES"; }
}
function GetCountry($ipadres) {
if ( $file = fopen("ip-to-country.csv","r") ) {
while ( $line = fgetcsv($file,1024,",") ) {
if ( ip2long($ipadres) >= $line[0] && ip2long($ipadres) <= $line[1] ) {
return $line[4];
}
}
}
return false;
}
if(($country != "BULGARIA") && ($isbot != "YES")) {
echo "<h2>Access Denied!</h2>";
exit;
}
?>