此段php统计代码如何加入防刷新功能?
<?php$counter=1;if(file_exists("counter.txt")){$fp=fopen("mycounter.txt","r");$counte...
<?php
$counter=1;
if(file_exists("counter.txt")){
$fp=fopen("mycounter.txt","r");
$counter=fgets($fp,9);
$counter++;
fclose($fp);
}
$fp=fopen("counter.txt","w");
fputs($fp,$counter);
fclose($fp);
echo "<h1>累计:".$counter."次<h1>";
?> 展开
$counter=1;
if(file_exists("counter.txt")){
$fp=fopen("mycounter.txt","r");
$counter=fgets($fp,9);
$counter++;
fclose($fp);
}
$fp=fopen("counter.txt","w");
fputs($fp,$counter);
fclose($fp);
echo "<h1>累计:".$counter."次<h1>";
?> 展开
1个回答
2015-06-16
展开全部
session记录是否访问过,当然可以绕过,最好的方法还是记录每天的ip
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询