无需数据库,简单方便统计网站次数
第一部分(统计代码,保存为count.php)
<?php
$datei = fopen("count.txt","r");
$count = fgets($datei,8888);
fclose($datei);
$count=$count + 1 ;
echo "$count" ;
echo " hits" ;
echo "\n" ;
$datei = fopen("count.txt","w");
fwrite($datei, $count);
fclose($datei);
?>
第二部分(插入统计代码,插入要统计的页面)
<?php
include("count.php");
?>