Jump to content

Quick/Wishlist using session variables?


Solarpitch

Recommended Posts

Hey Guys,

In the application I am developing I need to allow users to add an item to a "quicklist" where the user can view the stored items later. Just like youtube implement thier quicklist.

Would anyone be able to give me an overview on how to achieve this using session variables?

I take it I would have a variable(array or something) that stores all the selected advertisments that the user wants to add to thier list. Carry that from page to page and then display in quicklist_items.php?

Even example code would be fantastic!

Cheers!
Link to comment
https://forums.phpfreaks.com/topic/31139-quickwishlist-using-session-variables/
Share on other sites

How much later do you want them to be able to view the items? If its going to be maybe a day or two later, you will want a database, otherwise if it is all at once, before they logout of there browser, then sessions would be fine, But it would be best to know this.

You could also use a database for short term too, which could possibly be easier for managing items, but SESSIONS would be faster.
Na . . I wont be using a database because I want visitors to the site to be able to use this service too. So I know that if they close thier session or exit the page the list will be lost . . thats not a problem. I am just kinda stuck on how to implement it :)
ummm..

So, I have something like this..


Ad 1 ---> Add to Quicklist  User selects, adds to quicklist_variable
Ad 2 ---> Add to Quicklist
Ad 3 ---> Add to Quicklist  User selects, adds to quicklist_variable
Ad 4 ---> Add to Quicklist
Ad 5 ---> Add to Quicklist


So . . user has selected ads 1 and 3 to store in the quicklist. With ad id's of 1 & 3 respectively. These 2 ad id's are now stored in...

quicklist_variable  {1,3}


See . . it all sounds good in my head, but I kinda need a hand putting it into code a little. Session variables are not my strong point . . . at ALL! :(

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.