Re: PHP Redirect in the middle of code?

From: Date: Mon, 10 Sep 2001 15:18:33 +0000
Subject: Re: PHP Redirect in the middle of code?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-66764@lists.php.net to get a copy of this message
As others have mentioned, output buffering is what you want to look at. I've been doing some minor research on CF the past couple weeks, and it seems that CF, by default, always has output buffering on. While it's great for allowing redirects/header info to be pushed out wherever in a script, it apparently also consumes more memory, as the engine needs to keep a full copy of the output in memory before pushing it down. While there are definitely systems where this is desired, it's an option in PHP, but doesn't seem to be one in CF. (If anyone can tell me differently - which CF tag to use to toggle it on/off - please let me know). http://www.php.net/ob_start would be a place to start reading about output buffering, and the zend.com article is good as well. Andrew Penniman wrote:
I am trying to figure out how to use PHP to redirect the user to a new location *after* processing and most likely outputting a bunch of code. Because this redirection would happen late in the game I can't use header("Location: ".$redirect_to); I come from a ColdFusion background and am used to CFAS' <cflocation> tag. Does PHP have an equivalent function? I am really hoping not to use JavaScript, I want this redirection to happen at the server and not the client.


« previous php.general (#66764) next »