title: Website. VoteUp or VoteDown Videos. How to restrict users voting multiple times?
body: <p>Im working on a website (html,css,javascript, ajax, php,mysql), and I want to restrict the number of times a particular user votes for a particular video.</p>
  
  <p>Its similar to the YouTube system where you can voteUp or voteDown a particular video.</p>
  
  <p>Each vote involves adding a row to the video.votes table, which logs the time, vote direction(up or down), the client IPaddress( using PHP: $ip = $_SERVER['REMOTE_ADDR']; ), and of course the ID of the video in question.</p>
  
  <p>Adding votes is as simple as; (pseudocode): Javascript:onClick( vote( a,b,c,d ) ), which passes variables to PHP insertion script via ajax, and finally we replace the voteing buttons with a "Thank You For Voting" message.</p>
  
  <p>THE PROBLEM: </p>
  
  <p>If you reload/refresh the page after voting, you can vote again, and again, and again, you get the point. </p>
  
  <p>MY QUESTION: </p>
  
  <p>How do you limit the amount of times a particular user votes for a particular video?? </p>
  
  <p>MY THOUGHTS: </p>
  
  <p>Do you use cookies, and add a new cookie with the id of the video. And check for a cookie before you insert a new vote.? </p>
  
  <p>OR </p>
  
  <p>Before you insert the vote, do you use the IPaddress and the videoID to see if this same user(IP) has voted for this same video(vidID) in the past 24hrs(mktime), and either allow or dissallow the voteInsertion based on this query? </p>
  
  <p>OR </p>
  
  <p>Do you just not care? Take the assumption that most users are sane, and have better things to do than refresh pages and vote repeatedly.?? </p>
  
  <p>Any suggestions or ideas welcome. </p>