记要蜘蛛爬行历史-PHP版
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
リリース: 2016-06-13 11:34:10
记录蜘蛛爬行历史--PHP版
1 | function get_naps_bot(){ $useragent = strtolower ( $_SERVER [ 'HTTP_USER_AGENT' ]); if ( strpos ( $useragent , 'googlebot' ) !== false){ return 'Google' ;} if ( strpos ( $useragent , 'baiduspider' ) !== false){ return 'Baidu' ;} if ( strpos ( $useragent , 'msnbot' ) !== false){ return 'Bing' ;} if ( strpos ( $useragent , 'slurp' ) !== false){ return 'Yahoo' ;} if ( strpos ( $useragent , 'sosospider' ) !== false){ return 'Soso' ;} if ( strpos ( $useragent , 'sogou spider' ) !== false){ return 'Sogou' ;} if ( strpos ( $useragent , 'yodaobot' ) !== false){ return 'Yodao' ;} return false;} function nowtime(){ $date = date ( "Y-m-d.G:i:s" ); return $date ;} $searchbot = get_naps_bot(); if ( $searchbot ) { $tlc_thispage = addslashes ( $_SERVER [ 'HTTP_USER_AGENT' ]); $url = $_SERVER [ 'HTTP_REFERER' ]; $file = "robotlog.txt" ; $time =nowtime(); $data = fopen ( $file , "a" );fwrite( $data , "Time:$time robot:$searchbot URL:$tlc_thispage\n" );fclose( $data );}?>
|
ログイン後にコピー
このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
著者別の最新記事
-
2025-02-26 03:58:14
-
2025-02-26 03:38:10
-
2025-02-26 03:17:10
-
2025-02-26 02:49:09
-
2025-02-26 01:08:13
-
2025-02-26 00:46:10
-
2025-02-25 23:42:08
-
2025-02-25 22:50:13
-
2025-02-25 21:54:11
-
2025-02-25 20:45:11