Redirection to last url??

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Brian Huether

    Redirection to last url??

    I want my site to send users back to where they were prior to being told
    they have to login. For instance, say user accesses page1.php. They try to
    do something and they get a message telling them to login. So they login,
    which is done at login.php. After they log in, I want them to end up back at
    page1.php.

    Any idea how to do this?

    thanks,

    brian


  • Daniel Tryba

    #2
    Re: Redirection to last url??

    Brian Huether <bhuetherNO@com castspam.net> wrote:[color=blue]
    > I want my site to send users back to where they were prior to being told
    > they have to login. For instance, say user accesses page1.php. They try to
    > do something and they get a message telling them to login. So they login,
    > which is done at login.php. After they log in, I want them to end up back at
    > page1.php.
    >
    > Any idea how to do this?[/color]

    IMHO most often used:

    request: http://example.com/foo
    respons:
    if logged in: the content of http://example.com/foo
    if not : redirect to


    request: http://exmaple.com/login.php
    respons: authenticate user
    if autheticates and oldurl exists: redirect to $_GET['oldurl']
    if autheticates and oldurl misses: redirect to loggedin.html
    else get authentication

    Comment

    Working...