Obtain URL with Request.ServerVariables

Discussion in 'ASP General' started by crjunk, May 17, 2005.

  1. crjunk

    crjunk Guest

    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
     
    crjunk, May 17, 2005
    #1
    1. Advertising

  2. crjunk

    crjunk Guest

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

    Thanks!
    crjunk
     
    crjunk, May 17, 2005
    #2
    1. Advertising

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

    Response.Write sPath

    Ray at work

    "crjunk" <> wrote in message
    news:...
    > 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
    >
     
    Ray Costanzo [MVP], May 17, 2005
    #3
  4. crjunk

    Steven Burn Guest

    Request.ServerVariables("URL") & "?" & Request.ServerVariables("QUERY_STRING")

    --
    Regards

    Steven Burn
    Ur I.T. Mate Group
    www.it-mate.co.uk

    Keeping it FREE!

    "crjunk" <> wrote in message news:...
    > 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
    >
     
    Steven Burn, May 17, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Elliot M. Rodriguez
    Replies:
    1
    Views:
    673
    bruce barker
    Feb 12, 2004
  2. =?Utf-8?B?cHBhdGVs?=

    Request.ServerVariables ("HTTP_REFERER") using https

    =?Utf-8?B?cHBhdGVs?=, Mar 2, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    3,614
    Eric Lawrence [MSFT]
    Mar 3, 2004
  3. TS
    Replies:
    2
    Views:
    2,673
    Steven Cheng[MSFT]
    Jun 11, 2004
  4. L Scott
    Replies:
    1
    Views:
    743
    Nicole Calinoiu
    Aug 31, 2004
  5. =?Utf-8?B?aG4=?=
    Replies:
    3
    Views:
    25,636
    John Saunders
    Dec 16, 2004
Loading...

Share This Page