Page 1 of 1

cookies to bookmark posts

Posted: Thu Oct 15, 2009 3:18 pm
by ninethousandfeet
hi,

i am trying to figure out how i can allow the user to add as many bookmarked posts to a reference list. example, youtube uses this for their 'quicklist' feature. basically, i need to create a new cookie each time the user clicks the add button. a couple of things that are over my head on this problem:
- the add button needs to disappear next to that post as long as that cookie remains intact
- the reference list needs to reflect that 1 additional item is in it

i have a do...while loop for the posts. how can i create a unique cookie for each post in the loop?

so far i have something like this, but it doesn't work:

Code: Select all

 
<?php
$addbutton = image source code here;
$post = $row_post['post_info'];
$postNotOnList = $addbutton + $post;
 
do {
if ($_COOKIE['postID'] == '$row_post['postID']) {
echo $post;
} else {
echo $postNotOnList;
} while ($row_post = mysql_fetch_assoc)
?>
 
any ideas or help is greatly appreciated. thank you!