<?php
$countfile="/count.txt"; //设置保存数据的文件
if (!
file_exists($countfile)){//判断文件是否存在
exec( "echo 0 > $countfile");
}
$fp = fopen($countfile,"rw");
$length=filesize($countfile);
$num = fgets($fp,$length);
$num += 1;
exec( "rm -rf $countfile");
exec( "echo $num > $countfile");
print "访问量总计:"."$num"."人次"; //显示访问次数
?>