Forum Moderators: coopster

Message Too Old, No Replies

Saving favorite pages server side

         

horsewhip

10:14 pm on Aug 13, 2007 (gmt 0)

10+ Year Member



Hey all,
I have been looking around for a PHP script to manage internal page favorites...all i have found around are JS save favorites ~shiver~ I am looking for a script that allows users to save products they are interested in for later viewing...I have seen it in use on other sites, however had not been able to locate any reference to a script that does that...

Habtom

4:46 am on Aug 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I am sure if there is as such a script which can do this for you. But you can make one.

> Create a table in your database, and save it there when clicked.

> Create a cookie, and save the favourites in array cookie.

It depends on what you want to achieve.

Habtom

Metaphorically

2:57 pm on Aug 14, 2007 (gmt 0)

10+ Year Member



If you already have user info saved on your site then building another table for favourite products sounds like the sensible thing to do.

Suppose you have a product view page. On that page you have a link that says "add to favourites" and points to addToFavourites.php, passing the product id as a parameter. When the user clicks the link, addToFavourites.php takes the product id and the user id then adds both to the table in your database as a new row.

You'd also need a corresponding viewFavourites.php which queries the database table for all product ids from rows that have this user id.

It's pretty straightforward in principle but you should find something that works with whatever other packages you're using. If the site's all custom then your favourites script will be too.