/    Sign up×
Community /Pin to ProfileBookmark

"Add to Favorite" Button

Hi Everyone,
I am a student studying web development. I am creating a website with a photo gallery. When you visit the photo gallery page there are thumbnails you can click to view a larger image on the same page. Beside each image will be an add to favorites button.

My Question is :
How can i have an add to favorites button that the user will click on to take them to a login/register page where they can maintain/manage all their favorites. I have been looking for a script that does this for weeks with no luck. I would really appreciate it if someone is able to help me out with this as it is driving me nuts. Thank you so much.

to post a comment
PHP

10 Comments(s)

Copy linkTweet thisAlerts:
@DexterMorganMay 21.2010 — Hi Everyone,

I am a student studying web development. I am creating a website with a photo gallery. When you visit the photo gallery page there are thumbnails you can click to view a larger image on the same page. Beside each image will be an add to favorites button.

My Question is :

How can i have an add to favorites button that the user will click on to take them to a login/register page where they can maintain/manage all their favorites. I have been looking for a script that does this for weeks with no luck. I would really appreciate it if someone is able to help me out with this as it is driving me nuts. Thank you so much.[/QUOTE]


Hi, do you know much PHP and MYSQL?

If so, you could create a favourites table in your database listing a user ID and photo ID.

Then on the user's favourites page you could show all all of the images with the IDs that have been used in the favourites table with the user ID (if that sentence makes sense).
Copy linkTweet thisAlerts:
@sunlight444authorMay 21.2010 — Hi, do you know much PHP and MYSQL?

If so, you could create a favourites table in your database listing a user ID and photo ID.

Then on the user's favourites page you could show all all of the images with the IDs that have been used in the favourites table with the user ID (if that sentence makes sense).[/QUOTE]


Thanks for the response Dexter. I know how to create a Database and a table and that's pretty much it. Do you any tutorials for this i could follow.

I really want to learn how to do.

Thanks again for the reply.
Copy linkTweet thisAlerts:
@DexterMorganMay 21.2010 — Alright, thats a good start.

Have you ever created a relational database?

http://www.w3schools.com/php/php_mysql_select.asp

Some of the w3schools tutorials can be good for this sort of thing.

I can give you some help with various aspects of this if you need any.
Copy linkTweet thisAlerts:
@sunlight444authorMay 21.2010 — Alright, thats a good start.

Have you ever created a relational database?

http://www.w3schools.com/php/php_mysql_select.asp

Some of the w3schools tutorials can be good for this sort of thing.

I can give you some help with various aspects of this if you need any.[/QUOTE]


Thanks alot. I really appreciate it.

I created a login/register page at http://kurzdesign.ca/login/

The next step is to somehow attach the add to favorites link to the users profile so when they click on it, the favorite is saved to their profile. I am not very proficient in PHP but i want to learn how to do this.

Thanks again Dexter.
Copy linkTweet thisAlerts:
@DexterMorganMay 21.2010 — hmm I have never seen this before, is this code that you need to modify to create what you want?

For the add to favourites it will just be a simple link to a page which will have the code in to actually add it to the database.

I really think you should do a few of those w3schools database tutorials just to see how it all works then you will have it done in no time.
Copy linkTweet thisAlerts:
@sunlight444authorMay 21.2010 — hmm I have never seen this before, is this code that you need to modify to create what you want?

For the add to favourites it will just be a simple link to a page which will have the code in to actually add it to the database.

I really think you should do a few of those w3schools database tutorials just to see how it all works then you will have it done in no time.[/QUOTE]


Yes i am going through the w3 tutorial you sent me and some other basic ones right now. Do you think there will be a php file needed for this as well. How do i know what goes in the php file?

Thanks.
Copy linkTweet thisAlerts:
@DexterMorganMay 21.2010 — Yes i am going through the w3 tutorial you sent me and some other basic ones right now. Do you think there will be a php file needed for this as well. How do i know what goes in the php file?

Thanks.[/QUOTE]


Yeah there will be quite a few PHP files needed, dont worry though it is very easy to learn.

You need PHP files for all of the various processes that you want your website to do e.g you will want one to output all of the images, you will want one to show a single image(where I imagine you are going to put your favourites link) you will need one to logout etc etc.
Copy linkTweet thisAlerts:
@vman92May 21.2010 — I was looking for this. I had about the same question for my site: biscuitsandgravyrecipe.net. And, I think this answered my question.
Copy linkTweet thisAlerts:
@DexterMorganMay 22.2010 — I was looking for this. I had about the same question for my site: biscuitsandgravyrecipe.net. And, I think this answered my question.[/QUOTE]

Yeah the same technique can be applied to all sorts of things, not just a favourites sort of system.

I made a bookmarks like application a while ago using a very similar technique.
Copy linkTweet thisAlerts:
@fratdjAug 09.2012 — dexter morgan, i'm trying to set up a similar function for my website and i've been looking for people to help out. i'm not sure if this is the right place to go to but my business partners and I would be willing to hire you for any help you could give us.
×

Success!

Help @sunlight444 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...