Jump to content
ben3001

PHP Voting Script

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...