Redirecting (after output has started)
| From: | Don Don | Date: | Wed, 25 Apr 2007 13:25:53 +0000 |
| Subject: | Redirecting (after output has started) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-253698@lists.php.net to get a copy of this message | ||
Hi all, whats the best way to perform a redirect after out put has started ? using
header:location will not work unless theres been no output.
I usuall use the method below, however am concerned for browsers that do not support javascript.
$location = 'index.php';
echo "<script language='javascript'>\n";
echo "document.location.href = '" . $location . "';\n";
echo "</script>\n";
---------------------------------
Ahhh...imagining that irresistible "new car" smell?
Check outnew cars at Yahoo! Autos.