您好,欢迎访问一九零五行业门户网

蛛丝记录器_PHP

zmsj.php:
// 这个文件名为 zsmj.php
// 函数分析 $_server[http_user_agent] 信息,如果是搜索机器的特征字,就返回相应的值
// 否则返回 false
// 联系qq 733905
// email  zj#52linux.com (#换成@)
// homepage http://www.52linux.com
// good luck :)
function 52linux.com_zsmj()
{
$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;
}
?>
调用方法:
//调用程序
//作者 张建
// qq 733905
// email  zj#52linux.com (#换成@)
// 主页 http://52linux.com
//
//
$mysql_link_host=;
$mysql_link_name=;
$mysql_link_pass=;
$mysql_link_db  =;
// 上面改成符合你的 mysql连接参数
include('zsmj.php');
$sebotname = get_naps_bot();
if($sebotname  )
{
    $thispage = addslashes($_server[http_referer]);
    $sebotagent=addslashes($_server[http_user_agent]);
    $remote_ip=addslashes($_server[remote_addr]);
    $sql=insert into `zsmj` set botname='$sebotname',bottag='$sebotname',botagent='$sebotagent' ,botlast=now(),botlasturl='$thispage',botip='$remote_ip';
$mysql=@mysql_connect($mysql_link_host,$mysql_link_name,$mysql_link_pass);
    @mysql_db_query($mysql_link_db,$sql);
    @mysql_close($mysql);
}
print document.write(\
52linux.com搜索引擎访问记录器 ver 0.1 \);;
?>
数据库设计如下
create database zsmj;
use zsmj;
create table `zsmj` (
`botid` int(10) unsigned not null auto_increment,
`botname` varchar(100) not null default ,
`botagent` varchar(200) not null default ,
`bottag` varchar(100) not null default ,
`botlast` datetime not null default 0000-00-00 00:00:00,
`botlasturl` varchar(250) not null default ,
`botip`   varchar(20) not null default ,
unique key `botid` (`botid`),
key `botname` (`botname`)
) type=myisam auto_increment=9 ;
其它类似信息

推荐信息