On Wed, 15 May 2002, Olav Bringedal wrote:
> That is all well, but if php 4.2.1 interprets any
> output (as errors not only screen errors) as something
> that is sent before a header in a redirect, there is
> no other way (that i'm aware of) around it.
>
> Like this:
>
> $user=$Session["user"];
> if(!$Authorized)
> {
> header ("Location: http://jaggu.org");
> }
> this will not work, you have to write:
>
> @$user=@$Session["user"];
> @if(@!$Authorized)
> {
> header ("Location: http://jaggu.org");
> }
>
> To actually get the redirect.
That's not new to 4.2.1.
The solution remains the same as always: Choose between either:
A) Using output buffering; or
B) Make sure you don't generate any output before sending headers. You
don't need to stick @ in front of everything, just eliminate all errors
from your code and then make sure you aren't printing stuff.
For better or worse, there's no scapegoat here.
miguel
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php