Redirect a page after a few seconds in PHP

Have you ever tried refreshing a page with PHP? Most of the time we do refresh the page with either meta tag http-equiv=REFRESH or JavaScript.

But, there is a way in PHP where you can refresh or redirect to a page after a few seconds of time. We all know by using header() function we can redirect a page in PHP, but we don’t know that the same header can be used to delay some amount of time before redirect. Let’s see how this can be done!

Here is the script:

For your convenience here is one example program (save this file as test.php):

And Demo for you 🙂

demo

 

 

Related Posts

Leave a Reply