On Tue, 11 Sep 2001, Jason Brooke wrote:
> > Right off the top of my head, you have three options that I can see:
> >
> > (1) Rewrite the code to avoid any output before the redirect.
>
> I'd recommend this one myself
Me too, I can't think of a valid reason to use a Location header while
having output also as the user will only have about .00000002 seconds to
read the output before being redirected.
if ($foo == 'example') { // I'm not output
header('Location: http://www.example.com/');
exit;
}
is perfectly valid. Now, why would someone need to do :
if ($foo == 'example') {
echo 'Hope you find example.com pleasing, have fun!';
header('Location: http://www.example.com/');
exit;
}
If such an announcement is needed, using html Meta Refresh tag works as
one can also implement the delay (some of our users are slow readers :).
Also, headers_sent() can be useful. I'd personally avoid output buffering
for this.
Regards,
Philip Olson
>
> jason
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]