<?php
$SEARCH_ENGINES_UA = array(
// Google Web
'Mozilla/5.0 (compatible; Googlebot/2.1; +
http://www.google.com/bot.html)',
'Googlebot/2.1 (+
http://www.googlebot.com/bot.html)',
'Googlebot/2.1 (+
http://www.google.com/bot.html)',
// Yahoo! Web
'Mozilla/5.0 (compatible; Yahoo! Slurp;
http://help.yahoo.com/help/us/ysearch/slurp)',
// MSN web
'msnbot/1.0 (+
http://search.msn.com/msnbot.htm)',
'msnbot/0.9 (+
http://search.msn.com/msnbot.htm)',
'msnbot/0.11 (
http://search.msn.com/msnbot.htm)',
'MSNBOT/0.1 (
http://search.msn.com/msnbot.htm)',
);
if(in_array($_SERVER['HTTP_USER_AGENT'],$SEARCH_ENGINES_UA))
{
$body_top = "<br />";
$body_top .= "Atención, el siguiente robot de busqueda ha pasado por: ".$_SERVER['SERVER_NAME'];
$body_top .= "<br />";
$body_top .= "==============================================================<br />";
$body_top .= "User Agent:" . $_SERVER['HTTP_USER_AGENT'];
$body_top .= "<br />";
$body_top .= "Referer: " . $_SERVER['HTTP_REFERER'];
$body_top .= "<br />";
$body_top .= "Request Uri:" . $_SERVER['REQUEST_URI'];
$body_top .= "<br />";
$body_top .= "Date: " . date('l jS \of F Y h:i:s A');
$body_top .= "==============================================================<br />";
$subject = "Nueva visita de robot - " . $_SERVER['SERVER_NAME'];
$to = array("tumail@tuserver.com");//aca vas a recibir el mail
$cantidad = "1";
$cabeceras = 'MIME-Version: 1.0' . "\r\n";
$cabeceras .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$cabeceras .= "FROM: Tunombre <tumail@tuserver.com>\n";
//mando mail
for ($x=0;$x<$cantidad;$x++) {
@mail($to[$x],$subject,$body_top,$cabeceras);
}
}
?>