note 51542 deleted from function.header by bjori

From: Date: Mon, 27 Mar 2006 09:52:05 +0000
Subject: note 51542 deleted from function.header by bjori
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-106729@lists.php.net to get a copy of this message
Note Submitter: cbwhiz at hotmail dot com ---- "benjamin at sonntag dot fr 11-Mar-2005 07:03 About michael and it's header "Refresh", be careful, The HTTP standard requires the following syntax : <?php // Redirects the browser quickly (don't forget the URL=) header("Refresh: 0; URL=http://www.php.net"); ?> this is in fact the only way to prevent the multi-post issue with all browsers (ie, firefox ...)" I disagree. This is the correct way: <?PHP function postredir($url) { header('HTTP/1.1 303 See Other'); header("Location: ".$url); echo "We are now redirecting you to <a href='".urlencode($url)."'>$url</a>..."; } ?> 303 See Other means convert any request into a GET request - i.e. even if it submitted a POST request to this url, use GET on the redirected URL.

« previous php.notes (#106729) next »