Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Sep 2006
    Thanked 0 Times in 0 Posts

    Need help getting proper page to display after login

    If a user pastes a session-needed url into into their address bar, they'll hit the page and the script checks to see the logged in value in the cookie. If it's set, the pages loads, if it's not set user gets the login form.

    OK, all fine, but once the user logs in, they hit a welcome page instead of the initial URL they entered to the address bar.

    Any ideas on how to store this URL value they enter? And write in php, if this value is not null... display this page... otherwise if null display the welcome page?

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    In a place far, far away...
    Thanked 1,043 Times in 1,019 Posts
    What I do on one of my sites is I set a session for the user using
    [php]$_SESSION['goto'] = $_SERVER['REQUEST_URI'];[/code]
    This way on the page that they enter, it will save the url, after they log in you can check to see if the session is set by using isset. If its set then use the php header() to redirect them to the value of the session, if its not set redirect them to the welcome page.
    ||||If you are getting paid to do a job, don't ask for help on it!||||


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts