图片计数器

<!--#include file="conn.asp"-->
<%
dim action,countnum,upt
    'action=Request.querystring("action")
if session("action")="" then
   conn.execute("update Counts set counts=counts+1,updatetime='" & now() & "' where Id=1")
   rs.open "select * from Counts where Id=1",conn,1,2
   Countnum=rs("Counts")
   upt=rs("updatetime")
   rs.close()
   session("action")="action"  
else
   rs.open "select * from Counts where Id=1",conn,1,2
   Countnum=rs("Counts")
   upt=rs("updatetime")
   rs.close()
end if


Response.write "var numb='" & Countnum & "';" & vbcrlf
Response.write "var stringuptime='" & upt & "';" & vbcrlf
Response.write "var ll=numb.length;" & vbcrlf
Response.write "var stringimg='';" & vbcrlf
Response.write "for(i=0;i<ll;i++){" & vbcrlf
Response.write "stringimg+='<img src=../count/'+numb.substr(i,1)+'.gif>';" & vbcrlf
Response.write "}" & vbcrlf
Response.write "document.write ('截止:&nbsp;'+stringuptime+'&nbsp;本站累计访问量:&nbsp;'+stringimg);" & vbcrlf


方法二:
a=rs("counts")
for i=1 to len(rs("counts")
response.write "<img src=""&../count/"&mid(a,i,1)&".gif>"
response.write"&nbsp;"
next

 


%>

posted @ 2008-10-09 12:29  itecho  阅读(217)  评论(0编辑  收藏  举报