Codice PHP:
$agent = $_SERVER['HTTP_USER_AGENT'];
if (eregi("googlebot",$agent)) {
$page2 = "http://".$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF'];
$query2 = "INSERT INTO tb_logs VALUES (0,'googlebot','".$_SERVER["HTTP_USER_AGENT"]."','$page2',NOW());";
if (mysql_query($query2, $db)) {
// ****** qui non manca qualcosa??? ********
} else {
echo "Errore Irreversibile.";
}
}
io sapevo questo
Codice PHP:
$spider = $_SERVER['HTTP_USER_AGENT'];
if(eregi(".(google).",$spider))
{
$to = "webmaster@miosito.com";
$title = "Goolebot č passato";
$msg = "Goolebot č passato";
mail($to, $title, $msg);
}
ti manda un'e-mail quando passa.