How to Refresh a Page Periodically Using PHP
Topic: PHP / MySQLPrev|Next
Answer: Use the header()
Function
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.
Example
Try this code »<?php
header("refresh: 5;");
?>
Related FAQ
Here are some more FAQ related to this topic: