Obtain URL with Request.ServerVariables

C

crjunk

I have the following url:
https://test.mywebsite.com/secure/programs/test.asp?TOPIC_ID=21

How can I get the value "secure/programs/test.asp?TOPIC_ID=21"

I can't use Request.ServerVariables("HTTP_REFERER") because the user
may have the web page bookmarked.

I've also tried Request.ServerVariables("URL") but this only gave me
"secure/programs/test.asp". I need everything that comes after
https://test.mywebsite.com/.

Is there a Request.ServerVariables command that will give me this? I
know that there's got to be something that does this, but I'm having
problems finding info.

Thanks!
crjunk
 
C

crjunk

I finally figured out that I can use
request.servervariables("URL") & "?" & Request.querystring
to get what I want. Duh!!!

Thanks!
crjunk
 
R

Ray Costanzo [MVP]

sPath = Request.ServerVariables("URL")
sQString = Request.Querystring
If Len(sQString) > 0 Then sPath = sPath & "?" & sQString

Response.Write sPath

Ray at work
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top