分享一个自制的传奇发布站质量统计
<hide>
PHP代码,主页修改成index1.htm
ini_set('display_errors', false);
$ip = $_SERVER['REMOTE_ADDR'];
$refer = $_SERVER['HTTP_REFERER'];
preg_match('/[\w-]+\.(com|net|org|gov|cc|biz|info|cn)(\.(cn|hk))*/i', $refer, $match);
$domain = $match[0];
$nowtime = time();
$time = date('Y-m-d H:m:i', $nowtime);
$date = date('Y-m-d', $nowtime);
$str = $ip.'|'.$domain.'|'.$time;
$path = 'log/'.$date.'.txt';
$content = file_get_contents($path);
if (strpos($content, $ip) === false){
file_put_contents($path, $str."\r\n", FILE_APPEND);
}
include 'index1.htm';
</hide>
<hide>
PHP代码,主页修改成index1.htm
ini_set('display_errors', false);
$ip = $_SERVER['REMOTE_ADDR'];
$refer = $_SERVER['HTTP_REFERER'];
preg_match('/[\w-]+\.(com|net|org|gov|cc|biz|info|cn)(\.(cn|hk))*/i', $refer, $match);
$domain = $match[0];
$nowtime = time();
$time = date('Y-m-d H:m:i', $nowtime);
$date = date('Y-m-d', $nowtime);
$str = $ip.'|'.$domain.'|'.$time;
$path = 'log/'.$date.'.txt';
$content = file_get_contents($path);
if (strpos($content, $ip) === false){
file_put_contents($path, $str."\r\n", FILE_APPEND);
}
include 'index1.htm';
</hide>

