图片计数器
<!--#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 ('截止: '+stringuptime+' 本站累计访问量: '+stringimg);" & vbcrlf
方法二:
a=rs("counts")
for i=1 to len(rs("counts")
response.write "<img src=""&../count/"&mid(a,i,1)&".gif>"
response.write" "
next
%>