How to retrieve current page url?

Discussion in 'ASP General' started by Penny, Jun 17, 2005.

  1. Penny

    Penny Guest

    Hi all,

    How can I retrieve the current page url(and parameters/arguments) using ASP
    code?

    The current page is an asp search results page so the url includes the page
    name and the criterion(sorry I don't know what they're called) I had the
    'post' method tag on the end.

    I need to get it and store it so I have an easy way of getting back to this
    page at a click of a button a few pages down the track. I've tried using
    location and history but I'd like to manage it myself.

    Any ideas?

    Regards

    Penny.
    Penny, Jun 17, 2005
    #1
    1. Advertising

  2. Penny

    Adrienne Guest

    Gazing into my crystal ball I observed "Penny" <>
    writing in news::

    > Hi all,
    >
    > How can I retrieve the current page url(and parameters/arguments) using
    > ASP code?
    >
    > The current page is an asp search results page so the url includes the
    > page name and the criterion(sorry I don't know what they're called) I
    > had the 'post' method tag on the end.
    >
    > I need to get it and store it so I have an easy way of getting back to
    > this page at a click of a button a few pages down the track. I've tried
    > using location and history but I'd like to manage it myself.
    >
    > Any ideas?
    >
    > Regards
    >
    > Penny.
    >
    >
    >


    Request.ServerVariables("SCRIPT_NAME")

    --
    Adrienne Boswell
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
    Adrienne, Jun 17, 2005
    #2
    1. Advertising

  3. Penny

    Ken Jenkins Guest

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



    "Adrienne" <> wrote in message
    news:Xns9677B5734ED0Carbpenyahoocom@207.115.63.158...
    > Gazing into my crystal ball I observed "Penny" <>
    > writing in news::
    >
    >> Hi all,
    >>
    >> How can I retrieve the current page url(and parameters/arguments) using
    >> ASP code?
    >>
    >> The current page is an asp search results page so the url includes the
    >> page name and the criterion(sorry I don't know what they're called) I
    >> had the 'post' method tag on the end.
    >>
    >> I need to get it and store it so I have an easy way of getting back to
    >> this page at a click of a button a few pages down the track. I've tried
    >> using location and history but I'd like to manage it myself.
    >>
    >> Any ideas?
    >>
    >> Regards
    >>
    >> Penny.
    >>
    >>
    >>

    >
    > Request.ServerVariables("SCRIPT_NAME")
    >
    > --
    > Adrienne Boswell
    > http://www.cavalcade-of-coding.info
    > Please respond to the group so others can share
    Ken Jenkins, Jun 17, 2005
    #3
  4. Penny

    Penny Guest

    Thanks guys!!

    It all seems so simple to you.

    It's not a very intuitive name - ("script_name") - is it!

    Regards

    Penny
    Penny, Jun 17, 2005
    #4
  5. Penny

    Adrienne Guest

    Gazing into my crystal ball I observed "Penny" <>
    writing in news::

    > Thanks guys!!
    >
    > It all seems so simple to you.
    >
    > It's not a very intuitive name - ("script_name") - is it!
    >
    > Regards
    >
    > Penny
    >
    >


    Please understand that this method does not always work. If the user has
    referrer logging disabled, then that value will be blank when going to
    another page.

    From your original post, although you wanted to know the variable for
    THIS page, I think you really may be looking for Request.ServerVariables
    ("HTTP_REFERER") [yes, it's spelled right, apparently it was misspelled a
    long time ago, and it has stayed that way], but again, if the user has
    referrer logging disabled, it will not work. Also, if someone comes from
    another site directly to that page, the HTTP_REFERER will be for the
    other site.

    --
    Adrienne Boswell
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
    Adrienne, Jun 18, 2005
    #5
    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. wonder

    Retrieve current webpage url.

    wonder, Aug 18, 2004, in forum: Python
    Replies:
    0
    Views:
    302
    wonder
    Aug 18, 2004
  2. grimmus
    Replies:
    3
    Views:
    371
    Paul McGuire
    Sep 16, 2009
  3. Jack
    Replies:
    3
    Views:
    582
    Tad J McClellan
    Dec 22, 2008
  4. Replies:
    3
    Views:
    355
  5. Replies:
    1
    Views:
    277
    Thomas 'PointedEars' Lahn
    Mar 19, 2008
Loading...

Share This Page