您的位置:首页 > 编程语言 > ASP

asp静态网页点击数更新的方法

2013-09-29 20:42 218 查看
show_tool=channelItemName&"录入:"&rs("tjuser")&" | 浏览次数:<a id=""view_hits""></a><script type=""text/javascript"" language=""javascript"" src="""&InstallDir&"inc/cmsviewhits.asp?id="&aid&"""></script>"

end if

end if

--连接文件cmsviewhits.asp代码如下(本文来源于:校园派www.xiaoyuan-pai.com

<!--#include file="mdb.asp"-->

<%

dim sql,rs,aid,view_hits,t

On Error resume next

aid=clng(request("id"))

t=clng(request("t"))

if aid>0 then

set rs=server.createobject("adodb.recordset")

sql="select art_count from [art] where id="&aid

rs.open sql,conn,1,3

if not rs.eof then

rs("art_count")=rs("art_count")+1

view_hits=rs("art_count")

rs.update

end if

rs.close

set rs=nothing

end if

rs.close

set rs=nothing

end if

Response.write "document.getElementById(""view_hits"").innerHTML='" &view_hits& "';"

conn.close

set conn=nothing

参考:www.xiaoyuan-pai.com
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: