How do I wait a certain amount of time before continuing in PHP?
<p>So this is kind of two questions...</p>

<p>First off, when a user logs out, I want to redirect them back to the login page. I do this by using <code>header('login_form.php');</code>, however, prior to doing such, I try to print out the text "You have successfully logged out. You are now being redirected to the login form.". I do this using echo and echoing out the text, however, the header runs so quickly that I'm almost immediately transferred back to the login form, without getting a chance to read the message. So, how can I delay a little bit, and let the message display for just 5 seconds or so prior to redirecting the user with the header?</p>

<p>My second question is, what's the best way to simply display "incorrect login" above the login form? So, when I browse to the login form and enter an incorrect user/password, instead of going to "login.php" and then redirecting back to login_form.php, it simply determines whether the login was a success or not, and if not simply displays "Incorrect Login" above the input fields, as opposed to having to redirect back to login_form (which also doesn't notify the user that the login was incorrect).</p>
