I'm planning to create a voting page, where users can vote on different ideas or suggestions. I think for my situation it will be best to use a Thumbs Up / Thumbs Down type voting system. Can anyone explain how these work? Do they use division, average, etc?

Thanks

I'm planning to create a voting page, where users can vote on different ideas or suggestions. I think for my situation it will be best to use a Thumbs Up / Thumbs Down type voting system. Can anyone explain how these work? Do they use division, average, etc?

Thanks

thumbs up is +1,thumbs down is -1
thumbs up is +1,thumbs down is -1

Its ok the logic about the post, and his rating up with by 1, but i want to understand how to mark that one user is like the current post. If there no check about this, one user can use Tump UP more than 1 time. This is what i want to know, how to remember that user A is vote alrady for post B.

you can have one table for storing user_id and post_id.
When user vote any post there will be entry in that table and if there is any entry vote up-down arrow will not be shown for that post.

Do you have a system for users to login. That way you can make sure that only one user can vote once for a post, just like what vibhadevit says.In addition to the user_id and post_id, also put in the +1 or -1 which you can then use to calculate the rating.

Once you get that then either use (number of thumbs up - number of thumbs down) as a rating method or divide that number by the total of users voted and then multiply by 10 to get the rating on a 1-10 rating scale.

On the other hand if you do not have a login system, then you can use cookies, however, this is not a foolproof method since clearing the cookie cache would allow the user to vote again.

Create table for storing user_id and post_id.
When user vote any post there will be entry in that table check database if user has already post ie entry must be there in post_id with user_id if yes then dont show voting image use AJAX for this functionality it will be great.Using Ajax you can change image ie thumb up or thumb down .

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.