好多拼写错误,改如下如果是我,就会写如下
<? function counter()
{
global $userip;
$counterfile="count.txt";//保存访问量信息文件
$fd=fopen($counterfile,"r+");
$str=fread($fd,filesize($counterfile));
$count=explode("||",$str);
if($count[1]!=$userip){
$count[0]++;
$count[1]=$userip;
fseek($fd,0);
fputs($fd,implode("||",$count));
}
fclose($fd);
echo $count[0];
}
$userip=$REMOTE_ADDR;
counter();
<? function counter()
{
global $userip;
$counterfile="count.txt";//保存访问量信息文件
$fd=fopen($counterfile,"r+");
$str=fread($fd,filesize($counterfile));
$count=explode("||",$str);
if($count[1]!=$userip){
$count[0]++;
$count[1]=$userip;
fseek($fd,0);
fputs($fd,implode("||",$count));
}
fclose($fd);
echo $count[0];
}
$userip=$REMOTE_ADDR;
counter();
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货