Results 1 to 2 of 2

Thread: Request.ServerVariables("REMOTE_HOST")

  1. #1
    Join Date
    Dec 1969

    Default Request.ServerVariables("REMOTE_HOST")

    Hi<BR><BR>I use the function below to capture some HTTP variables.<BR><BR>&#060;% <BR>Function IIf(condition,value1,value2)<BR> If condition Then IIf = value1 Else IIf = value2<BR>End Function<BR><BR>varSite = Request.ServerVariables("HTTP_REFERER")<BR>varIp = Request.ServerVariables("REMOTE_ADDR")<BR>varHost = Request.ServerVariables("REMOTE_HOST")<BR>varDate = date<BR>strNothing = "No Referer (Direct Connection)"<BR><BR>If Request.QueryString("url") = "" Then<BR> varURL = Request.ServerVariables("URL")<BR>Else<BR> varURL = mid(Request.QueryString("URL"),25,100)<BR>End If<BR><BR>&#039;Create a connection to our database<BR>Set rst = Server.CreateObject("ADODB.Recordset")<BR>sqltext = "SELECT * FROM tblDistinctHost"<BR>rst.Open sqltext, "dsn=****;pwd=****",3,3<BR><BR>rst.AddNew<BR>i f varSite &#060;&#062; "" then<BR> rst("site")= varSite<BR>else<BR> rst("site")= strNothing<BR>end if<BR>rst("ip") = iif(varIp &#060;&#062; "", varIp, "Unknown IP Address")<BR>rst("host") = iif(varHost &#060;&#062; "", varHost, "Unknown Host")<BR>rst("date") = varDate<BR>rst("page") = varURL<BR>rst.Update<BR><BR>rst.Close<BR>Set rst = Nothing<BR>%&#062;<BR><BR><BR>Trouble is, the remote host, which should be the domain name of the visitor, comes back as an IP Address.<BR><BR>Can anyone help?<BR><BR>Thanks<BR><BR>Robert

  2. #2
    Join Date
    Dec 1969

    Default Stop reposting!

    If the domain name of the client is not given in the HTTP request, the remote host field will be fille din with the IP address of the client.<BR><BR>The problem may lie with the requesting computers, or some router/system along the path between the client and you. As for why? I&#039;m not sure. Why not repost the same question again and see if someone else can help you?<BR><BR>Craig.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts