title: PHP Form Security With Referer
body: <p>I'm putting together a site that will make itself available for user input.  I was wondering if writing a function like:</p>
  
  <pre><code>if(getenv("HTTP_REFERER") != 'http://www.myURL.com/submitArea'){
          die('don\'t be an jerk, ruin your own site');   
      }else{
          // continue with form processing    
      }
  </code></pre>
  
  <p>is enough to prevent cross site form submissions.</p>
  
  <p>EDIT:  And if not, what is the best practice for preventing forms from being submitted from other hosts?</p>