note 22804 deleted from function.header by victor
| From: | victor@php.net | Date: | Wed, 28 Aug 2002 06:35:24 +0000 |
| Subject: | note 22804 deleted from function.header by victor | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-35832@lists.php.net to get a copy of this message | ||
I created a script that redirected to a certain URL using:
header("Location: http://www.chexbox.com/");
and then went to yahoo.com. Then I came back and refreshed and it redirected without disabling the
forward button so it doesn't overwrite the pages that I had visited that were in my history
ahead of the script.
If you want it to overwrite that then use a meta tag in your HTML's header tags such as:
<meta http-equiv="refresh" content="3; url=http://www.chexbox.com/">
Which could be used as an alternative to the header-location. You could also use a function to
handle your redirects such as:
function meta_redirect($url="", $delay=1)
{
?><meta http-equiv="refresh" content="<?php print $delay; ?>;
url=<?php print $url; ?>"><?php
}