note 50482 deleted from function.header by bjori
| From: | bjori@php.net | Date: | Mon, 27 Mar 2006 09:53:13 +0000 |
| Subject: | note 50482 deleted from function.header by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-106733@lists.php.net to get a copy of this message | ||
Note Submitter: michael at whypsloven dot net
----
To redirect the user a certain amount of time after displaying content, use the Refresh, not the
Location header:
<?php
// Redirects the browser instantly
header("Location: http://www.php.net");
echo "This content is not displayed.";
// Redirects the browser quickly
header("Refresh: 0; http://www.php.net");
echo "This content is usually displayed by the browser in the instant before the next page can
be loaded.";
$sec = 10;
// Redirects the browser after $sec seconds
header("Refresh: $sec; http://www.php.net");
echo "This content is displayed for $sec seconds, then the browser will redirect.";
?>