惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
The Blog of Author Tim Ferriss
S
Securelist
D
Docker
The Register - Security
The Register - Security
GbyAI
GbyAI
Recorded Future
Recorded Future
Engineering at Meta
Engineering at Meta
Stack Overflow Blog
Stack Overflow Blog
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
罗磊的独立博客
博客园 - 【当耐特】
F
Full Disclosure
WordPress大学
WordPress大学
腾讯CDC
小众软件
小众软件
大猫的无限游戏
大猫的无限游戏
D
DataBreaches.Net
SecWiki News
SecWiki News
L
Lohrmann on Cybersecurity
I
InfoQ
MyScale Blog
MyScale Blog
量子位
Cyberwarzone
Cyberwarzone
博客园 - 三生石上(FineUI控件)
The Hacker News
The Hacker News
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Jina AI
Jina AI
博客园_首页
H
Help Net Security
K
Kaspersky official blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Webroot Blog
Webroot Blog
Blog — PlanetScale
Blog — PlanetScale
V
Vulnerabilities – Threatpost
Y
Y Combinator Blog
The Cloudflare Blog
P
Proofpoint News Feed
V
Visual Studio Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Tailwind CSS Blog
爱范儿
爱范儿
P
Privacy International News Feed
Security Archives - TechRepublic
Security Archives - TechRepublic
The GitHub Blog
The GitHub Blog
C
Cybersecurity and Infrastructure Security Agency CISA
B
Blog RSS Feed

博客园 - 亲,注意身体

magento 数据清理 magento top menu edit CookieConter 转换为string magento sitemap cms page remove home and generate sitemap error magento toplink blank li magento 语言包 magetno awblog auto generate title id, js replace magento moneybooker 操作 JS 正则 js 数组 组合(转) magento checkout require moneybooker api/mqi query magento moneybooker redirect 添加信任站点 bat 设置信任站点等级 moneybooker api 文档 magento htaccess Navicat 注册码,序列号 magento 修改订单号 Magento 删除所有订单 适于于1.4+
magento 记录蜘蛛爬行日志
亲,注意身体 · 2012-03-17 · via 博客园 - 亲,注意身体

<?php  
 function isSpider(){
    $bots = array(
                    'google'    => 'googlebot',
                    'yahoo'        => 'yahoo slurp',
                    'soso'        => 'sosospider',
                    'msn'        => 'msnbot',
                    'altavista'    => 'scooter',
                    'sogou'        => 'sogou spider',
                    'bing'        => 'bing',
                    'yodao'        => 'yodaobot',
                    
                    
            );
    $userAgent = strtolower($_SERVER['HTTP_USER_AGENT']);
    foreach ($bots as $k => $v){
    
        if (strstr($userAgent,$k)){
            return $v;
            break;
        }
    }
    return false;
}
$spi= isSpider();
if($spi){
    $tlc_thispage    = addslashes($_SERVER['HTTP_USER_AGENT']);
    //$file            = 'r.txt';
    $time            = date('Y-m-d H:i:s',mktime());
    //$handle            = fopen($file,'a+');
    $PR                = $_SERVER['REQUEST_URI'];
mysql_connect("localhost","root","");//连接MySQL
mysql_select_db("db");//选择数据库
$sql = "insert into robots(website,robot,url,agent,time) values ('website','$spi','$PR','$tlc_thispage','$time')";
mysql_query($sql);//借SQL语句插入数据
mysql_close();//关闭MySQL连接
 //echo  "Time:{$time} ROBOT:{$spi} AGENT:{$tlc_thispage} URL:{$PR} \n\r";
   // fwrite($handle, "Time:{$time} ROBOT:{$spi} AGENT:{$tlc_thispage} URL:{$PR} \n\r");
    //fclose($handle);
}
?>

CREATE TABLE `robots` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `website` varchar(20) NOT NULL,
  `url` varchar(300) NOT NULL,
  `robot` varchar(20) NOT NULL,
  `time` datetime DEFAULT NULL,
  `agent` varchar(50) DEFAULT '',
  PRIMARY KEY (`id`),
  KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;