电脑安全

您当前的位置:主页 > 电脑安全 >

php 文件计数据器+mysql双保护-网络编程

来源:[db:来源]标题:   这是    编辑:电脑技术全能网 时间:2019-09-18 16:49

原标题:php 文件计数据器+mysql双保护-网络编程
   php 文件计数据器+mysql双爱护,这是前次进级版了,前次流量大太常常出成绩明天修正过去了.<?phprequire_once("../inc/connect.php");Class Sit_count{ public $FileName = 'count.txt'; function Count_add(){if(file_exists($this->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.dnjishu.com/phper/php.html