title: Prevent duplicate record insertion on refresh without redirecting
body: <p>I have this bit of script:</p>
  
  <pre><code>if (isset($_POST['comment_posted'])) {
      $user_comment = mysql_real_escape_string($_POST['user_comment']);
      $add_user_comment = Event::addUserComment($id,$user-&gt;user_id,$user_comment);
  }
  </code></pre>
  
  <p>After a user submits his comment, and refreshes the page, he is being presented with the "you are going to resend the post data" warning. And if the user accepts, it will re-insert the user comment.</p>
  
  <p>I understand that I can prevent that by adding using the <code>header</code> function and redirect the member to the same page. Is it possible to solve this issue without redirecting the member?</p>