newbie question about header()
| From: | Scott Taylor | Date: | Mon, 22 Dec 2003 02:04:18 +0000 |
| Subject: | newbie question about header() | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-173121@lists.php.net to get a copy of this message | ||
I am simply trying to redirect users from one page to another. Yet when I use this code I get the following error:
*Warning*: Cannot add header information - headers already sent by (output started at /usr/local/psa/home/vhosts/miningstocks.com/httpdocs/etc/php/login/admin/test.php:8) in */usr/local/psa/home/vhosts/miningstocks.com/httpdocs/etc/php/login/admin/test.php* on line *9*
*
*
<html>
<head>
</head>
<body>
<?php
header('Location: http://www.slashdot.org/'); /* Redirect browser */
/* Make sure that code below does not get executed when we redirect. */
exit;
?>
</body>
</html>
I know the workaround with the meta tag (<meta http-equiv="REFRESH" content="0; URL=http://www.slashdot.org/">, but I just don't understand what I am doing wrong here. I'm sure someone here knows....
Thank you in advance,
Scott Taylor
scotttaylor@bigfoot.com