// проверка на бота
function isBot(){
$usd = $_SERVER['HTTP_USER_AGENT'];
$usd = strtolower($usd);
$botname = array("yandex" => "Yandex", "googlebot" => "Google",
"mediapartners-google" => "Mediapartners-Google (Adsense)", "slurp" => "Hot Bot search",
"webcrawler" => "WebCrawler search", "zyborg" => "Wisenut search",
"scooter" => "AltaVista", "stackrambler" => "rambler", "aport" => "Aport", "lycos" => "Lycos",
"webalta" => "WebAlta", "yahoo" => "Yahoo", "msnbot" => "msnbot/1.0",
"ia_archiver" => "Alexa search engine", "fast" => "AllTheWeb");
foreach($botname as $key => $value)
if (strstr($usd, $key)) {
$bot=$value;
break;
}
return isset($bot);
}