title: How do I stop the form fields from clearing on submission?
body: <p>I'm trying to create a php form with a captcha question, but on submit the form fields are emptied (annoying if they haven't filled in all required fields etc.). I'm sure the solution must be an easy one.</p>
  
  <p>Here's my submit code:</p>
  
  <pre><code>if ($_POST['submit']) {
      if ($name != '' &amp;&amp; $email != '') {
          if ($human == '4') {                 
              if (mail ($to, $subject, $body, $from)) { 
              echo '&lt;p&gt;Your message has been sent!&lt;/p&gt;';
              unset($_POST);
          } else { 
              echo '&lt;p&gt;Something went wrong, go back and try again!&lt;/p&gt;'; 
          } 
      } else if ($_POST['submit'] &amp;&amp; $human != '4') {
          echo '&lt;p&gt;You answered the anti-spam question incorrectly!&lt;/p&gt;';
      }
      } else {
          echo '&lt;p&gt;You need to fill in all required fields!!&lt;/p&gt;';
      }
  </code></pre>