Favorites list for site members

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Ozz
Forum Commoner
Posts: 26
Joined: Wed Aug 21, 2002 11:47 pm

Favorites list for site members

Post by Ozz »

I have a linksite. We publish links to our members.
I want to add a favorites feature for members.
There will be a "Add to favorites" link on every link.
When member click to that link it will be added member's favorites link list.
And there will be a favorites page to edit favorites like deleting a link from favorites.
I have php experience on beginner level.

Is this possible without a database integration?

Maybe favorite links can be held in a membername.txt file and that file can be edited for adding and deleting links.

How can I do that ?
Do you suggest another way to do that easily?
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

Afaik, you can read/write to files just as you can store/retrieve data from a database. Databases are faster though (I think).
evilcoder
Forum Contributor
Posts: 345
Joined: Tue Dec 17, 2002 5:37 am
Location: Sydney, Australia

Post by evilcoder »

i've actually written a Class that does this.... If you would like it, you can have it, but its very heavy duty and if your a beginner will probably be just characters infront of your screen.
decoy1
Forum Commoner
Posts: 50
Joined: Fri Feb 21, 2003 1:33 pm
Location: St. Louis

Post by decoy1 »

I wouldn't think of using a flat file in this case, or any really. Getting started using Mysql is the best way to go. Here are some good online tutorials to get you going.

http://www.webmasterbase.com/article/5 ... ial4.html
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

Forgot to say: tripod.co.uk give free accounts with php/mysql if you want to try it out.
Ozz
Forum Commoner
Posts: 26
Joined: Wed Aug 21, 2002 11:47 pm

Post by Ozz »

evilcoder wrote:i've actually written a Class that does this.... If you would like it, you can have it, but its very heavy duty and if your a beginner will probably be just characters infront of your screen.
Can you share that class evilcoder?

And yes I think a database will be a better idea.
decoy1
Forum Commoner
Posts: 50
Joined: Fri Feb 21, 2003 1:33 pm
Location: St. Louis

Post by decoy1 »

McGruff wrote:Forgot to say: tripod.co.uk give free accounts with php/mysql if you want to try it out.
Another option if you are running Windows, is to download the phpdev package. It installs Apache, PHP engine, and MySql on Win OS. You can also download PHPAdmin there too I think. This gives you a web based/gui interface to MySql.

http://www.firepages.com.au/dev4.htm

Installation is a breeze and is a good option for developing/testing on your local machine. Of course Linux comes with these things too and you won't have to boot your machine every other day.
Ozz
Forum Commoner
Posts: 26
Joined: Wed Aug 21, 2002 11:47 pm

Post by Ozz »

I already use php and mysql backend on my site.
http://www.limk.com
I didnt write the code and I need some improvements like favorites etc.
I use a favorites JS with cookie system.
I hope I could find a solution with database.
Post Reply