这是一段显示网页访问次数的代码,当如下代码加入主页后,主页打开的速度会很慢,可最后还是能打开,说明这段代码没有问题,请各位高手帮忙解决一下代码过繁的问题,谢谢!
<%
picture=slt
picnum=6
'POWERED BY SLIGHTBOY
set conn=Server.CreateObject("ADODB.connection")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("count15.mdb")
Set rs=Server.CreateObject("ADODB.Recordset")
sql= "select * from data where id=1"
rs.open sql,conn,3,3
'防刷代码开始
ip=Request.ServerVariables("REMOTE_ADDR")
'比对新老IP
if not ip=session("OldIp") then
session("OldIp")=ip
rs("counter")=rs("counter")+1
rs.update
counternum=rs("counter")
rs.close
else
counternum=rs("counter")
rs.close
end if
counternum=cstr(counternum)
for i=1 to (picnum-len(counternum))
counternum="0"&counternum
next
counter=""
for i=1 to len(counternum)
pic="<img src=../countl/images/"&picture&"/"&mid(counternum,i,1)&".gif>"
dispic="document.write(""" & pic & """);"
response.write dispic
next
%>
代码过繁的问题!