how can I get the url?

Discussion in 'ASP General' started by middletree, Jun 24, 2005.

  1. middletree

    middletree Guest

    How can I grab the URL and place it into an ASP/VBscript variable? I'm
    having a hard finding it in the documentation. Probably don't know the
    proper term to use.

    But if I am brought to a page, and it happens to to have an address of (this
    is for an Intranet app):

    http://intranet/displaydata.asp?custid=1&zip=12345&haircolor=brown

    then I'd like that whole thing. Not just the part before the ? mark, but
    each and every character.

    How do I do that?
     
    middletree, Jun 24, 2005
    #1
    1. Advertising

  2. middletree

    Ken Jenkins Guest

    Thispage = Request.ServerVariables("script_name") & "?" &
    Request.Querystring & Request.Form


    "middletree" <> wrote in message
    news:...
    > How can I grab the URL and place it into an ASP/VBscript variable? I'm
    > having a hard finding it in the documentation. Probably don't know the
    > proper term to use.
    >
    > But if I am brought to a page, and it happens to to have an address of
    > (this
    > is for an Intranet app):
    >
    > http://intranet/displaydata.asp?custid=1&zip=12345&haircolor=brown
    >
    > then I'd like that whole thing. Not just the part before the ? mark, but
    > each and every character.
    >
    > How do I do that?
    >
    >
     
    Ken Jenkins, Jun 24, 2005
    #2
    1. Advertising

  3. middletree

    Ken Jenkins Guest

    and you dont need the request form part in your case


    "Ken Jenkins" <> wrote in message
    news:uezI8$...
    > Thispage = Request.ServerVariables("script_name") & "?" &
    > Request.Querystring & Request.Form
    >
    >
    > "middletree" <> wrote in message
    > news:...
    >> How can I grab the URL and place it into an ASP/VBscript variable? I'm
    >> having a hard finding it in the documentation. Probably don't know the
    >> proper term to use.
    >>
    >> But if I am brought to a page, and it happens to to have an address of
    >> (this
    >> is for an Intranet app):
    >>
    >> http://intranet/displaydata.asp?custid=1&zip=12345&haircolor=brown
    >>
    >> then I'd like that whole thing. Not just the part before the ? mark, but
    >> each and every character.
    >>
    >> How do I do that?
    >>
    >>

    >
    >
     
    Ken Jenkins, Jun 24, 2005
    #3
  4. middletree

    Slim Guest

    "Ken Jenkins" <> wrote in message
    news:uezI8$...
    > Thispage = Request.ServerVariables("script_name") & "?" &
    > Request.Querystring & Request.Form
    >


    try this


    dim thisPage
    thisPage= "http://"& Request.ServerVariables("SERVER_NAME") &
    Request.ServerVariables("URL")

    if Request.Querystring <> "" OR Request.Form <> "" then
    thisPage = thisPage & "?" & Request.Querystring & Request.Form
    end if

    Response.Write thisPage





    >
    > "middletree" <> wrote in message
    > news:...
    >> How can I grab the URL and place it into an ASP/VBscript variable? I'm
    >> having a hard finding it in the documentation. Probably don't know the
    >> proper term to use.
    >>
    >> But if I am brought to a page, and it happens to to have an address of
    >> (this
    >> is for an Intranet app):
    >>
    >> http://intranet/displaydata.asp?custid=1&zip=12345&haircolor=brown
    >>
    >> then I'd like that whole thing. Not just the part before the ? mark, but
    >> each and every character.
    >>
    >> How do I do that?
    >>
    >>

    >
    >
     
    Slim, Jun 25, 2005
    #4
  5. middletree

    middletree Guest

    Ok, thanks very much!


    "Ken Jenkins" <> wrote in message
    news:...
    > and you dont need the request form part in your case
     
    middletree, Jun 27, 2005
    #5
  6. middletree

    Ken Jenkins Guest

    the actual article
    http://www.powerasp.com/content/new/get-current-page-url.asp



    "middletree" <> wrote in message
    news:...
    > How can I grab the URL and place it into an ASP/VBscript variable? I'm
    > having a hard finding it in the documentation. Probably don't know the
    > proper term to use.
    >
    > But if I am brought to a page, and it happens to to have an address of
    > (this
    > is for an Intranet app):
    >
    > http://intranet/displaydata.asp?custid=1&zip=12345&haircolor=brown
    >
    > then I'd like that whole thing. Not just the part before the ? mark, but
    > each and every character.
    >
    > How do I do that?
    >
    >
     
    Ken Jenkins, Jun 27, 2005
    #6
    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. Jason Zhou

    How can I get this url?

    Jason Zhou, Jun 29, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    352
  2. Jon paugh
    Replies:
    1
    Views:
    885
  3. Just D.
    Replies:
    0
    Views:
    511
    Just D.
    Aug 11, 2004
  4. David Thielen

    Get full url from relative url

    David Thielen, May 25, 2006, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    221
    David Thielen
    May 26, 2006
  5. Guy
    Replies:
    2
    Views:
    199
    Dr John Stockton
    Dec 5, 2003
Loading...

Share This Page