php判斷來訪蜘蛛的信息的函數,具體代碼如下:
function get_naps_bot(){
$useragent=strtolower($_SERVER['HTTP_USER_AGENT']);
if(strpos($useragent,'googlebot')!==false){
return 'Googlebot';
}
if(strpos($useragent,'msnbot')!==false){
return 'MSNbot';
}
if(strpos($useragent,'slurp')!==false){
return 'Yahoobot';
}
if(strpos($useragent,'baiduspider')!==false){
return 'Baiduspider';
}
if(strpos($useragent,'sohu-search')!==false){
return 'Sohubot';
}
if(strpos($useragent,'lycos')!==false){
return 'Lycos';
}
if(strpos($useragent,'robozilla')!==false){
return 'Robozilla';
}
return false;
}
*