I have the following php code that I want to add a delay too:
<?php
echo "Message has been sent.";
header("Location: page2.php", true, 303);
exit;
?>
The above code is too fast, so I do not see the message:
I tried:
<?php
sleep(5);
echo "Message has been sent.";
header("Location: page2.php", true, 303);
exit;
?>
This also does not display the message, but it is sleeping for 5 seconds, which is a waste of time.
How do I get it to display a message 5 seconds before redirecting?
source
share