title: How do I make sure my like button is pressed only once by user?
body: <p>Like Button's table</p>
  
  <ul>
  <li>LIKE_ID (unique like ID for each post) </li>
  <li>LIKES (number of times someone clicks like button) </li>
  <li>POST_ID (corresponds to the POST_ID of posts table)</li>
  </ul>
  
  <p>A separate post table has the POST_ID from above that is unique for each post</p>
  
  <p>A separate user table exists for users</p>
  
  <p>So when a user clicks the like button, it adds +1 to the Like table where post_id is whatever post they are liking.</p>
  
  <p>javascript file</p>
  
  <pre><code>$(document).ready(function() {
  $('img.like_click').click(function() {
  var form = $(this).closest('form[name=like_form]');
  var lid = $(form).find('input[name=lid]').val();
  $.post("like.php?lid='" + lid + "', function(data) {
  $(form).find('span.like_count').html(data);
  });
  });
  </code></pre>
  
  <p>like.php file</p>
  
  <pre><code>$lid = $_GET['lid'];
  mysql_query("UPDATE tbl_likes SET likes=likes+1 WHERE like_id=".$lid) or     die(mysql_error());
  $result = mysql_query("SELECT likes from files where fileid=" . $id) or die(mysql_error());
  $row = mysql_fetch_assoc($result);
  echo $row['likes'];
  </code></pre>
  
  <p>I can't figure out how to stop a user from liking over and over. I found facebook style like scripts on the web that stop people from doing this, but they are based on IP address (you can't like my posts if you are not logged in) and those codes were confusing to me as I am not a jquery guy. I'm still trying to figure out how to show the like button properly using the above code, but the hardest part is restricting multiple likes which has stumped me. Anyone can help? Thanks</p>