title: How to go about having PHP validation fall backs?
body: <p>just wondering what the best way to go about having both javascript and PHP validation.</p>
  
  <p>So, currently I have js validation for just an empty field and that then send the data to the PHP page.</p>
  
  <p>What can I do for e.g.</p>
  
  <pre><code>if ($_POST['username'] == '') {
     die();
  }
  </code></pre>
  
  <p>I want to have PHP validation for more security and also for people with js turned off. </p>
  
  <p>I could set a session on fail, and then check next to the field if there is a session set and then on true echo out a empty field message?</p>
  
  <p>But then how do I stop that working when js is enabled etc.</p>
  
  <p>Thanks for any help.</p>