Q:

How to Refresh a Page Periodically Using PHP

0

How to Refresh a Page Periodically Using PHP

All Answers

need an explanation for this answer? contact us directly to get an explanation for this 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.

<?php
header("refresh: 5;");
?>

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

PHP  and MySQL Frequently Asked Questions

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
How to Remove the Last Character from a String in ... >>
<< How to Push Both Key and Value Into an Array in PH...