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: cookies

  1. #1
    New to the CF scene
    Join Date
    Dec 2010
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    cookies

    Does anyone know how to have a cookie remember the previous page the viewer was viewing (url), so I can redirect them back there?

  • #2
    New Coder
    Join Date
    Oct 2010
    Posts
    29
    Thanks
    0
    Thanked 2 Times in 2 Posts
    You could just use:
    Code:
    header("Location: ".$_SERVER['HTTP_REFERER'])
    Then there is no need for a cookie.

    EDIT:
    Or if you need one, you can use:
    PHP Code:
    <?php
    setcookie
    ("RefererCookie"$_SERVER['HTTP_REFERER']);
    echo 
    $_COOKIE["RefererCookie"];
    ?>
    Last edited by jmace; 12-20-2010 at 11:18 PM.

  • #3
    New to the CF scene
    Join Date
    Dec 2010
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks Jmace!
    I think it may help!


  •  

    Posting Permissions

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