php判断来访蜘蛛信息的函数

 
更多

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;
}
打赏

本文固定链接: https://www.cxy163.net/archives/4509 | 绝缘体

该日志由 绝缘体.. 于 2013年05月23日 发表在 未分类 分类下, 你可以发表评论,并在保留原文地址及作者的情况下引用到你的网站或博客。
原创文章转载请注明: php判断来访蜘蛛信息的函数 | 绝缘体
关键字: , , , ,

php判断来访蜘蛛信息的函数:等您坐沙发呢!

发表评论


快捷键:Ctrl+Enter