Re: Redirecting (after output has started)

From: Date: Wed, 25 Apr 2007 21:43:19 +0000
Subject: Re: Redirecting (after output has started)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-253781@lists.php.net to get a copy of this message
On Wed, April 25, 2007 8:25 am, Don Don wrote: > Hi all, whats the best way to perform a redirect after out put has > started ? using header:location will not work unless theres been no > output. The BEST way is to re-structure your code logically, with the heavy lifting calculations done up-front, and the HTML output at the end, long after any decision about headers has been done. The SECOND BEST way is to just turn on output_buffering in php.ini or with http://php.net/ob_start so PHP can pull your ass out of the fire you've built around yourself. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?

« previous php.general (#253781) next »