Jump to content

Recommended Posts

Your sessions can't be viewed by other people. This is session lesson number 1. You need to store it elsewhere. Lesson number 2 is that sessions are temporary, and are not useful for long term lists.

 

Now, you DO need to post all your code for us to help you

Link to comment
https://forums.phpfreaks.com/topic/181245-a-unique-wishlist/#findComment-956146
Share on other sites

Hey there,

 

One thing before we get started...

*always post your code*

(and comment what you expect to get and what you actually get too, for future posts).

it never hurts to have more information...

 

Firstly, Sessions are really just temporary storage. They are highly unreliable for permanent storage as the use may clear their browser history, or be on a different computer, and everything is wiped/inaccessible. Don't get me wrong, sessions are great, but you should use the right tool for the job.

 

Wishlists lean more to the permanent storage side, although temporary storage measures, like sessions, can be used to build the wishlist. Definitely look into some long term storage solution, whether it is a file or a database, to store these wishlists. That way, when a user visits your site, you can always regenerate their wishlist, and you are not dependent on them keeping their browser files...

 

Sessions and other temporary storage solutions (variables are one, they are destroyed at the end of the PHP file execution) are sort of the middle men of the PHP game.

 

Okay, so, here are some solutions to use *in conjunction with* sessions.

 

- Databases

      - MySQL

      - PostgreSQL

- XML

 

There are others, but they may be more trouble than they are worth.

MySQL has a lot of support in the PHP community, so i'd go with that one, since it'll be easier to get help.

 

Here's a link to get you started:

http://www.tizag.com/mysqlTutorial/

 

More topics are covered on the left hand side or the continue button on the bottom.

 

Basically, your goal should be to:

- Uniquely identify the list (Primary Key)

- Tie a user to the list in some way (User id column)

- Serialize the array of items in the list, into the database

 

Hope this helps somewhat, i'm sort of taking a shot in the dark as to what it is you are after and your PHP coding comfort level. If you have any questions, I or the other nice people at PHPFreaks will be happy to help out! Also, make sure to mark the thread as "Solved" if someone answers your question.

 

Ryan

Link to comment
https://forums.phpfreaks.com/topic/181245-a-unique-wishlist/#findComment-956156
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.