Posted By

neal_grosskopf on 06/07/08


Tagged

path function ASP


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

neal_grosskopf
wizard04
asifrizvigmailcom
britevents


Getting Full URL/Path with ASP


 / Published in: ASP
 

URL: http://www.nealgrosskopf.com/tech/thread.asp?pid=13

One thing that always bothered me about Classic ASP is that there isn't an easy way to get the entire url. So I devised a function that will get the full path including the query string.

  1. function GetPath()
  2. query_string = request.ServerVariables("QUERY_STRING")
  3. if query_string <> "" then
  4. query_string = "?" & query_string
  5. end if
  6.  
  7. GetPath = "http://" & request.ServerVariables("SERVER_NAME") & request.ServerVariables("URL") & query_string
  8. end function

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: Scooter on June 7, 2008

What if the protocol is HTTPS instead of HTTP? You can check this via Request.ServerVariables("HTTPS")

You need to login to post a comment.