Forum Moderators: coopster
Teresa
For each page, you'll want some kind of unique identifier. If you just have articles, and all articles have a unique id that fetches them out of your db, this is real easy - just make a script 'savetomyfavorites.php' and on each article, make a link <a href="savetomyfavorites.php?articleno=345">, or whatever that article number is. savetomyfavorites.php then adds the number 345 to a field called favorites somehow in your users table (if articleno indeed is an integer) - probably the easiest would be to use explode(',' $articleno) and implode() to convert back and forth from a comma-separated list to an array.
Things are trickier if you don't have an easy unique idenitifier - if you want to have favorite saving available for pages with lots of different url structures. Then you have to use your page address as that identifier - put it into a parameter (maybe url encoding it first) - savetomyfavorites.php then will have to do some fancy checking to make sure your users aren't trying to put bad stuff in your db. You'll urldecode it probably, maybe do a regex check, and maybe other checks, to make sure it's free of things like ../ or other tricky stuff, and then saving it will be a bit more complicated too since you'll probably need to have a whole separate table, with a userid field and a field for the favorites, a new row for each entry.
Did you ever figure out how to do this? I've been searching for something like this for a week and have had no luck.