[thelist] PHP Header oddness

Mark Rees mrees at itsagoodprice.com
Fri Oct 7 08:53:17 CDT 2005


> I find that when I turn off output_buffering, something strange happens.
> I call it a bug.  I have a workaround, but I am curious, has anyone else
> seen this issue and I am curious what you have done about it.
>
>      if($retval) {
>          $session->set('useredit', true);
>          header("Location: ".$session->get(Session::REFERRER));
>      }


What is in $retval? Is it always evaluating to true? PHP can perform some
unexpected conversions if you're not familiar with what goes on behind the
scenes. Try replacing

if($retval) {

with
      if($retval==0)
or
if (isset($retval))
or whatever you expect it to be

Hope this helps

Mark




More information about the thelist mailing list