首页 > 网站 > 静态页面的点击量统计问题

静态页面的点击量统计问题

2007年7月1日 发表评论 阅读评论

我们在打开这个含有的静态页面的时候,将读出此时的点击数

1.模板页中的点击数后面添加:
以下是代码片段:


备注:在生成Html的文件中将$Id$替换为对文章在数据库中的id号

2.counter.asp
以下是代码片段:
<% dim Id,sqlStr,hits Id=int(trim(request.querystring("Id"))) sqlStr="update News set hits=hits+1 where Id=" & Id ’给文章点击数加1 conn.execute(sqlStr) ’读出文章点击数 hits=conn.execute("select hits from News where Id=" & Id)(0) %>
’输出文章点击数
document.write(<%=hits%>)

分类: 网站 标签: 2,504 次阅读
原文链接:http://www.wenhq.com/article/view_76.html
欢迎转载,请注明出处:亲亲宝宝
  1. 本文目前尚无任何评论.
  1. 本文目前尚无任何 trackbacks 和 pingbacks.