/**
* BOT CHECKER SCRIPT
*
* Loest beim betreten der Seite von google o. andere spider eine email an den admin aus
*
**/
// returns TRUE if the haystack string contains one of the strings
// from needle array, if needle is not found returns FALSE (case-insensitive)
function arristr($haystack='', $needle=array())
{
foreach($needle as $n)
{
if (stristr($haystack, $n) !== FALSE )
{
return TRUE;
}
}
return FALSE;
}
$haystack=$_SERVER['HTTP_USER_AGENT'];
$needle=array('googlebot', 'spid', 'scooter', 'bot', 'slurp', 'grub', 'crawl', 'scan', 'szukacz');
if(arristr($haystack, $needle))
{
$inhalt = $_SERVER['HTTP_USER_AGENT'];
$inhalt .= "Datum: ".date("d.m.Y").", Zeit: ".date("H:i");
// sende email an admin
@mail("alert@studio-shop.com","crawler/spider/bot info",$inhalt,"From: server@studio-shop.com");
}
/**** BOT CHECKER SCRIPT ENDE ***/
?>