title: PHP - wait a couple of seconds before continuing?
body: <p>I've set up a HTML form and I'm using PHP to verify that everything is good before displaying a message on the webpage. I then want to redirect the user back to the home page after a couple of seconds.</p>
  
  <p>Problem is, I can't find a way to wait 5 seconds or so and then do the redirect. The sleep function simply waits 5 seconds and then displays the message/redirects at the same time. Anyone got any ideas?</p>
  
  <p>Thanks!</p>
  
  <pre><code>&lt;?php
      if (empty($_POST) === false) {
      echo 'Success! You will not be able to log in until an administrator approves your account.';
      sleep(5);
      $url = 'index.html';
      echo '&lt;META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'"&gt;';  
  }
  ?&gt;
  </code></pre>