<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <% Dim strIP strIP=Request.ServerVariables("HTTP_X_FORWARDED_FOR") If strIP="" Or InStr(strIP,"unknown") Then strIP=Request.ServerVariables("REMOTE_ADDR") ElseIf InStr(strIP,",") Then strIP=Split(strIP,",")(0) ElseIf InStr(strIP,";") Then strIP=Split(strIP,";")(0) End If userip = Trim(strIP) 'Response.Write userip set rs=Server.CreateObject("ADODB.Recordset") sql="select * from online where datediff(""d"",edit_date,date())=0 And ip='"&userip&"'" rs.Open sql,Conn,1,3 if rs.eof then '第一次浏览 'Response.Write 1 rs.addnew rs("ip")=userip rs("add_date")=now() rs("edit_date")=now() rs("visit")=1 else '非第一次浏览 'Response.Write 2 rs("visit")= rs("visit") +1 rs("edit_date")=now() '更新时间 end if rs.update rs.close set rs=nothing %>