title: Limit a function to once per IP address without user logins
body: <p>I'm building a site that allows you to post comments to a page and vote on other comments, except it's all anonymous, there are no user logins whatsoever.</p>
  
  <p>I already have a comment rating system in place, but currently there's nothing stopping someone from just repeatedly rating a comment to their heart's content.</p>
  
  <p>I need to make it so once you vote, that's it. You can't go back on it, and you can't vote on that same post again.</p>
  
  <p>Here's an example, my rateup.php file:</p>
  
  <pre><code>&lt;?php
  include("config.php");
  
  $post_id = $_GET['id'];
  
  // Connection to database
  $connection=mysqli_connect("$servername","$username","$password","$dbname");
  // Check connection
  if (mysqli_connect_errno()) {
      echo 'oops';
      //echo "Failed to connect to MySQL: " . mysqli_connect_error();
  }
  
  // Increasing the current value with 1
  
  mysqli_query($connection,"UPDATE $tablename SET upvotes = (upvotes + 1) WHERE id = $post_id");
  mysqli_close($connection);
  
  echo 'done';   ?&gt;
  </code></pre>
  
  <p>Honestly, I had a hard time even thinking of how to explain this problem.</p>
  
  <p>Thank you!</p>