最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
在静态页面中实现点击数统计
时间:2008-01-11 编辑:简简单单 来源:一聚教程网
经考虑,可用如下方案解决:
生成静态页面时会产生一个文章的id存到数据库中,那么我们在制作文章的模板的时候就可以在这个文章的id上做文章,文章模板包含以下语句:
说明:
在利用模板生成文章时,把"#articleId#"进行模式匹配,替换为新添加的文章的id号。
counter.asp 文件为实现记数的asp文件
<%
''###################
''######开始#########
''BY 王向超
''###################
dim articleId,sqlStr,hits
articleId=int(trim(request.querystring("articleId")))
sqlStr="update articles set hits=hits+1 where articleId=" & articleId
''给文章点击数加1
conn.execute(sqlStr)
''读出文章点击数
hits=conn.execute("select hits from articles where articleId=" & articleId)(0)
%>
''打印出文章点击数
document.write(<%=hits%>)
-
上一个: 用PHP连接Oracle数据库
-
下一个: PHP实现网页自动更新块
相关文章
- seo 静态页面 09-22
- 静态页面统计代码 05-24
- 静态页面实现点击 05-20
- PHP导出数据超时的优化建议解读 10-31
- PHP之mysql位运算解析 10-31
- Laravel实现登录跳转功能解析 10-31