RE: [PHP] PHP Redirect in the middle of code?
| From: | Andrew Penniman | Date: | Mon, 10 Sep 2001 17:23:19 +0000 |
| Subject: | RE: [PHP] PHP Redirect in the middle of code? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-66784@lists.php.net to get a copy of this message | ||
The Steve Edberg (option #2) and Michael Kimsal suggestions to use
ob_start() output buffering work like a charm. Thanks so much! I would
have been a long time coming before I mad this connection on my own.
Guess I need to hone my archive querying skills...
I think it would be _really_ swell if the documention for header()
mentioned output buffering as a means of tweaking the headers,
especially header("Location: ".$redirect_to), in mid-code.
I Fusebox my pages (www.fusebox.org) so I only need to add a single
ob_start() and ob_end_flush() call to my source tree. If I'm
redirecting then I call ob_end_clean(); header("Location:
".$redirect_to); and everything works like a charm!
Cheers!