<%@ Language=VBScript %> <% if len(Request("referer")) <> 6 then if len(Request("repage")) > 0 then Response.Redirect( Request("repage") ) else Response.Redirect( "/" ) end if end if 'browser Dim sBrowser sBrowser = Request.ServerVariables("http_user_agent") 'IP address Dim sIPAddress sIPAddress = Request.ServerVariables("remote_addr") 'DNS lookup of the IP address Dim sDNSLookup sDNSLookup = Request.ServerVariables("remote_host") Session("Affiliate") = Request("referer") Dim oConn ' Connection object. Dim oRS ' Recordset object. Dim sSQL ' SQL query string. ' Open a connection. Set oConn = Server.CreateObject("ADODB.Connection") oConn.Open application("QN_ConnectionString") ' Generate query string. sSQL = "INSERT into " & "quotenavigator..AffiliateHit ( " & _ "sAffiliateCode" & _ ",dHitDate " & _ ", sBrowser" & _ ", sIPAddress" & _ ", sDNSLookup" & _ " ) " & _ "VALUES ( " & _ TextInput(Request("referer")) & _ ", " & TextInput(Now) & _ ", " & TextInput(doQuoteCheck(left(sBrowser,100))) & _ ", " & TextInput(doQuoteCheck(sIPAddress)) & _ ", " & TextInput(doQuoteCheck(sDNSLookup)) & _ " ) " ' Execute the query. debugit "sSQL", sSQL Set oRS = oConn.Execute(sSQL, lRecs, 1) Set oRS = nothing Set oConn = nothing if len(Request("repage")) > 0 then Response.Redirect( Request("repage") ) end if Response.Redirect( "/" ) %>