<% Option Explicit response.buffer = true Dim ipAddr, hostName, userAgent, connection, rstemp ipAddr = Request.ServerVariables("REMOTE_ADDR") set connection=server.createobject("adodb.connection") connection.open Application("strConn") set rstemp=connection.execute("select ip_addr from pm_spiders where ip_addr = '" & sqlItem(Left(ipAddr,16)) & "' ") if rstemp.eof then ' New spider IP address found.... hostName = Request.ServerVariables("REMOTE_HOST") userAgent = Request.ServerVariables("HTTP_USER_AGENT") connection.execute("insert into pm_spiders (ip_addr, host_name, agent_name, date_found, publication_found, allow_normal) values ('" & sqlItem(Left(ipAddr,16)) & "', '" & sqlItem(Left(hostName,255)) & "', '" & sqlItem(Left(userAgent,255)) & "', getDate(), '" & Application("publication_id") & "', 0) ") end if function sqlItem(theItem) if IsNull(theItem) = false then sqlItem = replace(theItem, "'", "''") else sqlItem = "" end if end function %> User-agent: * Disallow: