<%@ LANGUAGE = VBScript %> <% Dim ip, platform, browser, resolution, camefrom, visited, color, remotehost Dim adoCon, RS, strConn platform = Request.ServerVariables("HTTP_USER_AGENT") ip = Request.ServerVariables("REMOTE_ADDR") visited = request.servervariables("SCRIPT_NAME") camefrom = request.servervariables("HTTP_REFERER") remotehost = request.servervariables("REMOTE_HOST") Response.write(ip & " " & platform &" " & " " & remotehost & visited & Now()) resolution = request.querystring("w") & " x " & request.querystring("h") Set adoCon = Server.CreateObject("ADODB.Connection") set RS = Server.CreateObject("ADODB.Recordset") strCon = "DRIVER={Microsoft Access Driver (*.mdb)};" strCon = strCon & "DBQ=" & Server.MapPath("tracking") strSql= "INSERT INTO stat (url, platform, browser, resolution, ip, camefrom, visited)" strSql=strSql & "VALUES" strSql=strSql & "('" & request.querystring("u") & "'" strSql=strSql & ",'" & platform &"'" strSql=strSql & ",'" & request.querystring("b") &"'" strSql=strSql & ",'" & resolution & "'" strSql=strSql & ",'" & ip &"'" strSql=strSql & ",'" & request.querystring("r") &"'" strSql=strSql & ",'" & now &"')" adoCon.open strCon adoCon.Execute(strSql) set RSUpdate = nothing set RS=nothing Dim uadoCon, uRS, ustrConn Set uadoCon = Server.CreateObject("ADODB.Connection") set uRS = Server.CreateObject("ADODB.Recordset") ustrCon = "DRIVER={Microsoft Access Driver (*.mdb)};" ustrCon = ustrCon & "DBQ=" & Server.MapPath("tracking") ustrSQL = "SELECT * FROM count WHERE url = '" & request.querystring("u") & "';" uadoCon.open ustrCon uadoCon.Execute(ustrSQL) uRS.open ustrSql, ustrCon, 3 If uRS.EOF OR uRS.BOF Then Set adoCon = Server.CreateObject("ADODB.Connection") set RS = Server.CreateObject("ADODB.Recordset") strCon = "DRIVER={Microsoft Access Driver (*.mdb)};" strCon = strCon & "DBQ=" & Server.MapPath("tracking") strDOB = 1 strSql= "INSERT INTO count (url, counter)" strSql=strSql & "VALUES" strSql=strSql & "('" & request.querystring("u") & "'" strSql=strSql & "," & strDOB &")" adoCon.open strCon adoCon.Execute(strSql) Else strDOB = uRS("counter") + 1 ustrSql= "UPDATE count SET counter = " & strDOB &" WHERE url = '" & request.querystring("u") & "';" uadoCon.Execute(ustrSql) END If set uRS=nothing 'strCon.close 'strCon.close %>