How to Refresh a Page Periodically Using PHP
Answer: Use the
You can simply use the
header() function to automatically refresh a page periodically (i.e. at certain time intervals) using PHP. Please, note that
header() function must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP script.
The following example will refreshes the current page every five seconds.
ExampleTry this code »
<?php header("refresh: 5;"); ?>
Here are some more FAQ related to this topic: