if($_SERVER['HTTP_REFERER'] == ''){
die('Referer boş');
}if(strpos($_SERVER['HTTP_REFERER'],$_SERVER['HTTP_HOST'] == false){
die('Sayfaları site üzerinden gezin');
} 22
●3.982
<?
function kontrol($urls){
foreach($urls as $key => $value){
preg_match('@^(?:http://)?([^/]+)@i', $_SERVER['HTTP_REFERER'], $matches);
preg_match('/[^.]+\.[^.]+$/',$matches[1], $matches);
if($matches[0]==$value)
return true;
}
return false;
}
if(!kontrol(array(
'siteadi.com',//başında http ve www olmayacak...
'siteadi2.com' ,
)
)
)
die('izin yok');
?>Ama şunuda söyliyeyim adress satırından girememesini engelliyorsun ama bu tam bir çözüm değildir. Firefox eklentisi ile çok rahat aşılıyor bu engel...
<?
function kontrol($urls){
foreach($urls as $key => $value){
preg_match('@^(?:http://)?([^/]+)@i', $_ENV['HTTP_REFERER'], $matches);
preg_match('/[^.]+\.[^.]+$/',$matches[1], $matches);
if($matches[0]==$value)
return true;
}
return false;
}
if(!kontrol(array(
'siteadi.com',//başında http ve www olmayacak...
'siteadi2.com' ,
)
)
)
die('izin yok');
?> 
