1 <?php
2  $useragent = addslashes(strtolower($_SERVER['HTTP_USER_AGENT']));
3 if (strpos($useragent, 'googlebot')!== false){$bot = 'Google';}
4 elseif (strpos($useragent,'baiduspider') !== false){$bot = 'Baidu';}
5 if(isset($bot)){
6 $fp = @fopen('bot.txt','a');
7 fwrite($fp,date('Y-m-d H:i:s')."\t".$bot."\t".'http://'.$_SERVER['SERVER_NAME'].$_SERVER["REQUEST_URI"]."\r\n");
8 fclose($fp);
9 }
10 ?>

 

相关文章:

  • 2021-05-14
  • 2021-10-10
  • 2021-06-16
  • 2022-12-23
  • 2022-12-23
  • 2021-10-27
  • 2021-09-19
  • 2022-12-23
猜你喜欢
  • 2021-11-01
  • 2022-12-23
  • 2022-12-23
  • 2022-02-26
  • 2022-02-20
  • 2022-12-23
  • 2021-08-18
相关资源
相似解决方案