note 50085 deleted from function.header by bjori
| From: | bjori@php.net | Date: | Mon, 27 Mar 2006 09:53:44 +0000 |
| Subject: | note 50085 deleted from function.header by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-106734@lists.php.net to get a copy of this message | ||
Note Submitter: vernonj at gmail dot com
----
when redirecting to another page
<? header(Location: file.php); ?>
you must make sure you put the header function before all output..otherwise you'll end up with
an error such as:
'Warning: Cannot modify header information - headers already sent by'
however this causes great inconvenience, a quick work around is to use javascript to allow you to
redirect to any page from anywhere in your script no matter if output has already started, by using:
<? echo "<script> self.location(\"file.php\");</script>"; ?>