ASP : Detecting the user's IP Address

Created 25 June 2002 00:00, updated 17 June 2017 10:05
  forwardIP = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
  remoteAddr = Request.ServerVariables("REMOTE_ADDR")

  ' check to see if the user is behind a proxy (forwardIP will be populated)
  If forwardIP = "" then
    Response.Write "Your IP address is: " & remoteAddr
  Else
    Response.Write "Your IP address is: " & forwardIP & "<br>"
    Response.Write "Your proxy address is: " & remoteAddr
  End If