After loading the web page, PHP no longer starts. This means that you cannot do anything with PHP after loading the page, unless you use something like AJAX (Javascript calling the PHP page) to transfer data to the page. This gives you several methods to achieve your desired 10 second redirect wait.
First, you can tell your script sleep () for 10 seconds. This, however, as Jonathan mentioned, means that you would look as if your page was very slow, just to let the user redirect.
sleep(10);
You can also simply add a META tag that tells the page to redirect itself in 10 seconds. This is the preferred method since it does not include almost any other encoding, since you just throw the META label and you donβt have to deal with javascript at all.
<meta http-equiv="refresh" content="10;url=http://example.com"/>
Then you may also have a problem with Javascript: location.href = "bleh"; after waiting for 10 seconds.
Tyler carter
source share