jesse1981
5/8/2013 - 6:36 AM

Method to get the current page URL.

Method to get the current page URL.

function curPageURL()
  dim s, protocol, port

  if Request.ServerVariables("HTTPS") = "on" then
    s = "s"
  else
    s = ""
  end if  

  protocol = strleft(LCase(Request.ServerVariables("SERVER_PROTOCOL")), "/") & s 

  if Request.ServerVariables("SERVER_PORT") = "80" then
    port = ""
  else
    port = ":" & Request.ServerVariables("SERVER_PORT")
  end if  

  curPageURL = protocol & "://" & Request.ServerVariables("SERVER_NAME") &_
  port & Request.ServerVariables("SCRIPT_NAME")
end function