redirect

Discussion in 'ASP General' started by Andie, Aug 18, 2003.

  1. Andie

    Andie Guest

    Hello.

    How do I redirect a page back to the orginal sending page.

    I have a script that checks to see if a user is logged in and if he.she
    isn't then it redirects them to a loging page, one login has been checked
    and process, how do I redirect them to the original page.

    --
    To reply, remove "TRASH" from email address

    Thanks,

    Andie
    Andie, Aug 18, 2003
    #1
    1. Advertising

  2. On your page that checks the logon;

    if NotLoggedOn
    Response.Redirect "logon.asp?return=" &
    Server.URLEncode(Request.ServerVariables ("SCRIPT_NAME"))
    end if

    In logon.asp;

    ....code to logon the user...
    response.redirect Request("return")

    That is the general idea anyway.


    >-----Original Message-----
    >Hello.
    >
    >How do I redirect a page back to the orginal sending page.
    >
    >I have a script that checks to see if a user is logged in

    and if he.she
    >isn't then it redirects them to a loging page, one login

    has been checked
    >and process, how do I redirect them to the original page.
    >
    >--
    >To reply, remove "TRASH" from email address
    >
    >Thanks,
    >
    >Andie
    >
    >
    >.
    >
    Adrian Forbes - MVP, Aug 18, 2003
    #2
    1. Advertising

  3. Andie

    Randy Rahbar Guest

    > I have a script that checks to see if a user is logged in and if he.she
    > isn't then it redirects them to a loging page, one login has been checked
    > and process, how do I redirect them to the original page.


    You could append the name of the page onto the redirect as a querystring.

    Use request.servervariables("script_name") to get the name of the page
    current page. It'd work something like this...

    If UserNotLoggedOn
    response.redirect "login.asp?r=" &
    request.servervariables("script_name")
    End If
    Randy Rahbar, Aug 18, 2003
    #3
    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. Mark Kamoski
    Replies:
    1
    Views:
    7,094
  2. bagsmode
    Replies:
    2
    Views:
    5,499
    bagsmode
    Jul 28, 2003
  3. =?Utf-8?B?VHJveQ==?=

    Response.redirect does not redirect from .aspx page

    =?Utf-8?B?VHJveQ==?=, Oct 18, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    5,235
    Srowe1975
    Oct 15, 2008
  4. Sal
    Replies:
    1
    Views:
    408
  5. Ron Howard
    Replies:
    2
    Views:
    518
    Ron Howard
    Aug 11, 2004
Loading...

Share This Page