i am trying to figure out how i can allow the user to bookmark a post they like. if they do bookmark a post, then it would need to appear in their bookmark list. i don't want to store this info in my db, so i was thinking of trying something like youtube's quicklist feature, which i'm pretty sure uses cookies.
my basic understanding to achieve this, would be to create a new cookie each time the user clicks the add button.
the problems that i cannot figure out:
- the posts are retrieved and presented in a do...while loop, and each post has a unique postID, then how can i make sure a post that hasn't been added to the user's bookmark list has the add button? (i.e. if a cookie for that post does not exist on the user's computer, then display the add button ELSE do not display the add button)
- how do i show the number of bookmarks in the user's bookmark list? for example, if i have zero in the list, then bookmark list should not be there. but if i have 1 bookmark in the list it should appear as: bookmarks (1). then let's say i add a bookmark, it would be: bookmarks (2), etc.
so far i have something like this, but it doesn't work:
<?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? thank you in advance for the help!

New Topic/Question
Reply




MultiQuote





|