您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

php 文件计数据器+mysql双保护

2024/3/24 6:49:53发布20次查看
php 文件计数据器+mysql双保护,这是上次升级版了,上次流量大太经常出问题今天修改过来了.
filename) ){
    $temp = file_get_contents($this->filename);    
    $array = explode(=,$temp); 
    if(count($array) != 2){   
     $tmp ='mytext='.$this->tcount();
    }else{
     $total = $array[1]+1;  
     $tmp =$array[0].'='.$total;      
    }
    $t = @fopen($this->filename,'w');
    if($t){
     fwrite($t,$tmp);
     fclose($t);
    }
    mysql_query(update wk_count set count_bak =count_bak+1 where id=1);
   }else{
    echo '! file_exists';
   }
}
function tcount(){
    $result =mysql_query(select * from wk_count where id =1 ) or die(mysql_error());
   $rs =mysql_fetch_array($result);
   return $rs['count_bak'];
}
 }
  $tp = new sit_count;
  $tp->count_add();
?>
本站原创转载注明www.111cn.net/phper/php.html
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product