Jump to content

PHP Voting Script


ben3001

Recommended Posts

Hey guys,I'm trying to find a solution to my ratings script problem.At the moment I have a simple thumbs up and down script which posts +1 in the corresponding field (votes_up or votes_down). The only security I have at the moment preventing the user from voting numerous times is a cookie is set with the commentID. I then have a statement that: if cookie is set, then do not display voting thumbs. This is my temporary solution but i'm sure there is another way.Is it possible to post many values into one field in a mysql database seperated by commas?The idea I have is that when the user votes their user id is posted into the user_vote field along with all the other id's that have voted seperated by commas.If is possible then I would have a script that searchs each userid, and if there isn't a match then display voting form.Have you got any suggestions?CheersB

Link to comment
Share on other sites

The only security I have at the moment preventing the user from voting numerous times is a cookie is set with the commentID. I then have a statement that: if cookie is set, then do not display voting thumbs. This is my temporary solution but i'm sure there is another way.
cookie can be delted or edited..so your polling could be compromised.
is it possible to post many values into one field in a mysql database seperated by commas?
you can put anything in your db..it will also workbut i think best will be..creating a table for all votes..which will be linked to votetopic and user table.now in vote table make votetopic and voteby column unique constraint..so it will be impossible to put a vote twice for some user.if you are going to do this by unregistered user..only way i can imagine is checking by IPits all depend on you..which one suites you better.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...