// 访客计数器函数
function counter() {
!empty($_GET['weburl']) || die('weburl不能为空');
$weburl = $_GET['weburl'];
$file = '/usr/local/apache/htdocs/MyTests/counter.txt';
if (! file_exists($file)) {
$num = 1;
$cf = fopen($file, 'w');
fwrite($cf, $weburl.' '.$num);
fclose($cf);
} else {
$cf = fopen($file, 'rw');
$num = fgets($cf);
$num = substr($num, 15);
fclose($cf);
++$num;
$cf = fopen($file, 'w');
fwrite($cf, $num);
fclose($cf);
}
}
?>
访客计数器
欢迎访问
您是第位访客
已抢186765个
抢已抢67353个
抢已抢353278个
抢已抢667695个
抢已抢122838个
抢已抢24281个
抢