>  기사  >  php教程  >  dedecms ajax 下载统计代码

dedecms ajax 下载统计代码

WBOY
WBOY원래의
2016-06-08 17:29:44978검색

dedecms ajax 下载统计代码

<script>ec(2);</script>

require_once (dirname(__FILE__) . "/include/common.inc.php");
require_once(DEDEINC."/channelunit.class.php");

 $aid = (isset($aid) && is_numeric($aid)) ? $aid : 0;
 
  $rand =mt_rand(10,80);
  
  $query = "select count(*) as dd from #@__downloads where id='$aid'";
  
  $row = $dsql->GetOne($query); 
 
  if($row['dd'] > 0)
  {
   $query = "update #@__downloads set downloads=downloads+$rand where id='$aid'";
   $dsql->ExecNoneQuery($query);
  }else {
   $query = "insert into #@__downloads(hash,id,downloads) values('null$aid','$aid',1)";
   $dsql->ExecNoneQuery($query);
  }
  

下面是实例方法。








缁胯
성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.