在网上找了很多关于ASP静态页面点击率的解决办法,但是都没有效果,后来仔细研究,终于明白了到底问题出在哪里...
==========================================================
在生成的静态页面点击率的位置添加如下代码:
<script language="javascript" src="1.asp?id=1"></script>
==========================================================
在1.asp中写入如下代码:
<!-- #include file="conn.asp" -->
id=request("id")
sql="update news set hits=hits+1 where id="&id
conn.execute(sql)
sql="select hits from news where id="&id
rs.open sql,conn,1,1
If rs.eof Then
Else
response.write "document.write("&rs("hits")&")"
End If
rs.close
Set rs=nothing
%>
==========================================================
注:在最后输出的时候要写成:
response.write "document.write("&rs("hits")&")"
如果不写 "document.write",静态页面中是不会显示点击数的
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。