title: How to prevent duplicate posts via a browser refresh?
body: <p>Will the following stop accidental duplicate entries in my database if the user posts a form and then clicks the browser refresh button?</p>
  
  <pre><code>&lt;?php
      if( $_SERVER['REQUEST_METHOD']=='POST' ) {
  
          try {
              // write to database
          } catch($e) {
              // error reporting
          }
      }
  ?&gt;
  </code></pre>