Question:
How to prevent multiple voting? (PHP & MySQL)?
Nik
2012-04-15 06:39:55 UTC
I basically have a voting system for games. I'm building an ecommerce website and am inputting a feature to allow users to vote on games good or bad. Now I have PHP knowing if someone has voted and knowing how to store this vote what I don't want is people voting multiple times.

My plan was to create a separate table and store the games ID along with the users IP and if PHP detects a connection disable the form. But two problems I was worried this may take up a lot of DB space although this ecommerce site is never going public its simply a learning thing so there are not going to be thousands of people using it.

Secondly they can simply change their IP but does anyone really care enough to do so.

Any thoughts how these systems work and am I going about it right or wrong and any alternatives if wrong.

Thanks
Four answers:
2012-04-15 07:08:48 UTC
Basically you need a unique identifier such as a user id, if you allow users to log into your website. If the voting is public only you are tied to using an IP address, a cookie or an email address (that requires verification reply) as that identifier even though it can be cheated.
2012-04-15 06:43:02 UTC
They can change their IP yes or it can automatically change. You can simple use session data as a means of stopping them voting until the session runs out however it would be much more prudent to make a login script as to have proper accounting to then track what people have and haven't voted for. You can also stores these session keys and reassign them when a particular person logs bag in but for simplicity sake just make it so one session needs to end before voting again and stop the same IP voting twice.
?
2016-10-22 01:37:46 UTC
you're making no sense. if you're examining archives from the same table you purely use this to loop for the period of which it without delay does. yet then you definately favor to both create a reveal string by technique of concatenating the format and effect techniques, or purely echo each and every effect in turn. Breaking the code contained in the at the same time as brackets is undesirable practice, and makes the code not plausible to debug in case you get it incorrect. so that you purely favor the same code for each line displayed. And why the for some thing which isn't a link.
2012-04-15 16:38:34 UTC
Good day mate. To unblock internet sites and surf anonymously I really propose using http://www.vpnmaster.com


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...