note 22804 added to function.header

From: Date: Sun, 30 Jun 2002 20:52:24 +0000
Subject: note 22804 added to function.header
Groups: php.notes 
Request: Send a blank email to php-notes+get-32446@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 } -- http://www.php.net/manual/en/function.header.php http://master.php.net/manage/user-notes.php?action=edit+22804 http://master.php.net/manage/user-notes.php?action=delete+22804 http://master.php.net/manage/user-notes.php?action=reject+22804

« previous php.notes (#32446) next »