Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

PHP Cookies

  • 01-06-2006 10:46AM
    #1
    Registered Users, Registered Users 2 Posts: 1,454 ✭✭✭


    A mate is a designer and runs a large ecommerce site in the UK, he ask me how via php it would be possible to record the last 5 pages that a customer has visited.

    Does anyone know where I can start with this ?

    I can add soemthing like

    <?php
    setcookie("Product", <ProductID><ProductName>, time()+60*60*24*30);
    ?>

    on each unique page , but from the looks of the help file this will only store the last page , as it will overwrite the cookie, ideally I want one cookie storing all product id's and names , whcih I can then use to populate a drop down.


Comments

  • Closed Accounts Posts: 169 ✭✭akari no ryu


    Why neccessarily cookies?
    Surely an array in session would be better, wherein if count($_SESSION)>5 you pop?


  • Registered Users, Registered Users 2 Posts: 1,454 ✭✭✭Smoggy


    Sounds good to me , In was going with cookies , so it would last linger than a session , but a session would work well.

    - Havent coded PHP for ages, what little I knew I have forgotten


Advertisement