Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4999709
  • 博文数量: 921
  • 博客积分: 16037
  • 博客等级: 上将
  • 技术积分: 8469
  • 用 户 组: 普通用户
  • 注册时间: 2006-04-05 02:08
文章分类

全部博文(921)

文章存档

2020年(1)

2019年(3)

2018年(3)

2017年(6)

2016年(47)

2015年(72)

2014年(25)

2013年(72)

2012年(125)

2011年(182)

2010年(42)

2009年(14)

2008年(85)

2007年(89)

2006年(155)

分类:

2007-11-11 20:16:55

function count_hit(){
 var article_id=document.getElementById('article_id');
 
 
 var url="../../count.php?article_id="+article_id.value;
 var ajax=InitAjax();
 var sh12=document.getElementById('hitcount');
 
 ajax.open("GET",url,true);
 ajax.(){
  if(ajax.readyState==4 && ajax.status==200){
   
   sh12.innerHTML=ajax.responseText;
   
   }
  
  }
 
 ajax.send(null);
 
 }
 
<td>浏览次数:<div id="hitcount"></div></td>
 
 
function count_hit($id){
    global $db;
    $sql="update {$this->tablename} set article_hitcount=article_hitcount+1 where article_id=".$id;
    $db->query($sql);
    $rt=$db->search("{$this->tablename}","article_hitcount","article_id=".$id,2);
    echo $rt['article_hitcount'];
    
   }
 
 
 
 
<?
include_once("inc/mall.inc.start.php");
include_once('smarty.inc.php');
$article->tablename=$conf['news_article_info'];
$article->count_hit($_GET['article_id']);
?>

阅读(2629) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2008-03-31 14:23:27

dfjh