Re: redirecting without headers or meta tags or javascript
| From: | (Chris Adams) | Date: | Tue, 03 Apr 2001 15:58:16 +0000 |
| Subject: | Re: redirecting without headers or meta tags or javascript | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-46837@lists.php.net to get a copy of this message | ||
On 3 Apr 2001 06:26:47 -0700, Justin French <justin@indent.com.au> wrote:
>> (3) Use output buffering
>
>huh? appreciate mroe on this...
put ob_start() at the top of your page and ob_end_flush() at the bottom. PHP
will store all of the output instead of sending it to the browser. If you put a
header("Location: foo"); exit; somewhere, that output will never be set.
(Take a look at the ob_* functions in the manual when you have a spare moment -
there's some pretty cool things you can do with them, particularly if you use
the gz handler to compress pages on the fly.)