Skip to content

Instantly share code, notes, and snippets.

@jesse1981
Created May 8, 2013 06:36
Show Gist options
  • Save jesse1981/5538651 to your computer and use it in GitHub Desktop.
Save jesse1981/5538651 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment