% 'if Request.ServerVariables("HTTP_REFERER")="" then 'response.Redirect (index.asp) 'response.End() 'end if dim max,suiji,userip,rs,rs_add sub click_in(k_id) set rs=server.createobject("adodb.recordset") rs.open "select [in],[out],[pv],[inout],[kl],[ip],[name],[uptime],[id] from [users] where id="&k_id,conn,3,2 if not rs.eof then application.lock Randomize userip = Request.ServerVariables("HTTP_X_FORWARDED_FOR") If userip = "" Then userip = Request.ServerVariables("REMOTE_ADDR") if day(rs("uptime"))<>day(now()) then call add() rs("uptime")=now() if rs("id")=21 or rs("id")=147 then rs("in")=100 else rs("in")=1 end if rs("out")=1 rs("pv")=1 rs("inout")=1 end if max=Int(rs("kl")/10) suiji=Int((10-1+1)*Rnd()+1) if max >= suiji and trim(rs("ip"))<>userip then rs("in")=rs("in")+1 rs("inout")=rs("in")/rs("out")*(70+30*rs("pv")/rs("in")) rs("ip")=userip end if application.unlock rs.update 'response.Write(rs("in")&"|") 'response.Write(rs("inout")) 'response.End() rs.close set rs=nothing Response.cookies("userid")=k_id response.cookies("userid").Expires=DateAdd("d",1,now()) Response.cookies("userpv")=k_id response.cookies("userpv").Expires=DateAdd("s",10,now()) end if end sub sub add() set rs_add=server.createobject("adodb.recordset") rs_add.open "select * from [tongji]",conn,3,2 rs_add.addnew rs_add("date")=rs("uptime") rs_add("in")=rs("in") rs_add("out")=rs("out") rs_add("pv")=rs("pv") rs_add("name")=rs("name") rs_add.update rs_add.close set rs_add=nothing end sub dim last,url,userid,llqz,llym,llqz_ym,ll_host,wz_end,rft On Error Resume Next 'url=Cstr(Request.ServerVariables("SERVER_NAME")) llqz=Cstr(Request.ServerVariables("HTTP_REFERER")) llym=Cstr(Request.ServerVariables("SERVER_NAME")) llqz_ym=replace(llqz,"http://","") if(Instr(llqz_ym,"/") <=0) then ll_host = llqz_ym else wz_end=instr(llqz_ym,"/")-1'返回/字符串在网址字符串中第一次出现的位置 ll_host=Mid(llqz_ym,1,wz_end) end if if ll_host<>llym then 'if ll_host<>"" then 'response.redirect "../index.htm" url=ll_host url="http://"&url 'if Request.ServerVariables("SERVER_NAME")<>"" then 'url="http://ww.kk.com" 'response.Write url set rft=server.createobject("adodb.recordset") rft.open "select * from [users] where dizhi like '%"&url&"%'",conn,3,2 'userid=cint(request("userid")) userid=rft("id") rft.close set rft=nothing 'response.Write userid if userid<>"" and userid<>0 and request.Cookies("userid")="" and request.Cookies("userid_out_"&userid)="" then 'if userid<>"" then 'response.Write userid call click_in(userid) 'response.Write Request.ServerVariables("HTTP_REFERER") end if 'if userid<>"" then 'call click_in(userid) 'end if end if %>