<% 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 private sub transferurl() %> document.write("") document.write(""); <% end sub sub updatedb() filename=findname(Request.QueryString("comeurl"))'//获取文件名 conn.execute("update gallery set gallery_hits=gallery_hits+1 where gallery_filename='"&filename&"'") end sub if Request.QueryString("act")="save" then call updatedb() else call transferurl() end if call closeconn() %>