网站开发与移动开发

博客园 首页 新随笔 管理

访问次数,

在统计页面加入以下这个代码

<SCRIPT src="static_click.asp?articleid=<%=articleid%>"></SCRIPT >

对应的ASP文件为

<!-- #include file="inc/conn.asp" -->
<%

articleid=int(trim(request.querystring("articleid")))
sqlStr="update product set hits=hits+1 where articleid=" & articleid
'给文章点击数加1
conn.execute(sqlStr)
'读出文章点击数
hits=conn.execute("select hits from product where articleid=" & articleid)(0)
Response.Redirect productshow&"_"&articleid&.htm
%>

document.write(<%=hits%>) 
---------------------------------------------- 

posted on 2007-08-22 09:39  txf2004  阅读(135)  评论(0编辑  收藏  举报