<% Function findname(filepath) for i=1 to len(filepath) if left(right(filepath,i),1)="/" then '查找"/,取得字符数" k=i exit for end if next if k<>1 then findname=right(filepath,k-1) end if findname=left(findname,14) '//取得前14个字符,即图片集的文件名 end Function myname=Request.ServerVariables("SCRIPT_NAME") current_url="http://"& Request.ServerVariables("SERVER_NAME") &"/" '获取当前域名,构造URL sub transferurl() %> document.write("") document.write(""); <% end sub sub updatedb() dim filename,gethits filename=findname(Request.QueryString("comeurl"))'//获取文件名 gethits=conn.execute("select gallery_hits from gallery where gallery_filename='"&filename&"'") Response.Write ("document.write('"&gethits(0)&"')") end sub if Request.QueryString("act")="view" then call updatedb() else call transferurl() end if call closeconn() %>