Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: referral page

  1. #1
    New Coder
    Join Date
    Feb 2003
    Posts
    63
    Thanks
    0
    Thanked 0 Times in 0 Posts

    referral page

    I am writing a forum add, f_add.php where it will check if the person has already login or not, if no, then it will go to the login page and then going back to the previouse f_add.php...

    my problem is when the f_add.php directs the user to login.php, I use $_SERVER['HTTP_REFERER'] to remember the page it comes in, but it is not the f_add.php page but the page i visited before f_add.php....

    so how can I implement this, so the user can login and redirect to the page they have requested?

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,273
    Thanks
    4
    Thanked 83 Times in 82 Posts
    How are you directing people in the f_add.php page?
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #3
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Try.

    PHP Code:
    // You will have to do all your logging in stuff,
    // I am using the var $is_logged_in to check 
    // login status.

    if($is_logged_in)
    {
          
    header($_SERVER['HTTP_REFERER']);
    }
    else
    {
          
    // FAIL LOGIN

    I have never used http_referer ( dunno why ) but thats what I would try.


  •  

    Posting Permissions

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