Re: redirect with header() after headers sent

From: Date: Tue, 29 Aug 2000 19:27:12 +0000
Subject: Re: redirect with header() after headers sent
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-14313@lists.php.net to get a copy of this message
On Wed, Aug 30, 2000 at 03:01:43PM +1000, Jason Murray wrote: > > > > Any thoughts / suggestions / help would be appreciated. > > The way I create a PHP-based site is to have the pages create their content > and then at the very end of the page include the standard page menu > template, > then the actual contents and the standard page footer. This way you can send > a Header() at any time, or set a cookie whenver you want/need to. You might > want to consider doing it this way. The problem with your current set up is, > once the SQL error occurs, the page is halfway on its way to the browser, > and > you can't stop that. > > Jason Yeah, I realize the page was halfway out the door and that to sent a new header() I would need to stop it and then send the header. I guess I was hoping someone might know a way to force a page to end without calling exit in php4. I may end up having to move all php code prior to my do_header() call which is on the standard template I prepend with auto_prepend_file but I was looking for a better solution since I'm not the only developer on the site. It's easy to fix my habits but I'd rather not inspect everyones code and fix it as well. -- Scott

« previous php.general (#14313) next »