header location delay
<p>I have the following php code which I want to add a delay too:</p>

<pre><code>&lt;?php
    echo "Message has been sent.";
    header("Location: page2.php", true, 303);
    exit;
?&gt;
</code></pre>

<p>The above code happens too fast so I can't see the message:</p>

<p>I have tried:</p>

<pre><code>&lt;?php
    sleep(5);
    echo "Message has been sent.";
    header("Location: page2.php", true, 303);
    exit;
?&gt;
</code></pre>

<p>This doesn't display the message either, but it does sleep for 5 seconds, which is just a waste of time.</p>

<p>How do I get it to display a message for 5 second before redirecting?</p>
