contact.php ye

@$ref=$_SERVER['HTTP_REFERER'];
if(!eregi('index.php',$ref)){
echo "izinsiz giriş";
exit();
}