经测试代码如下:
<?PHP
/**
* 记录Google机器人访问足迹
*
* @param
* @arrange (512.笔记) jb51.cc
**/
$email = "test@test.com";
if(eregi("googlebot",$HTTP_USER_AGENT))
{
if ($QUERY_STRING != "")
{
$url = "http://".$SERVER_NAME.$PHP_SELF.'?'.$QUERY_STRING;
} else {
$url = "http://".$SERVER_NAME.$PHP_SELF;
}
$date = date("F j,Y,g:i a");
mail($email,"[Googlebot] $url","$date - Google crawled $url");
}
/*** 代码来自编程之家 jb51.cc(jb51.cc) ***/
原文链接:https://www.f2er.com/php/528836.html