|
Posted by Erwin Moller on 11/28/06 14:19
Christoph Burschka wrote:
> You can't send a Location header after sending cookies (which
> session_start() does).
>
> So you either need to find a way to reload without starting a session,
> or you need to print a <meta> refresh tag into the page to reload it...
Or you buffer the output by calling ob_start() at the start of the script.
:-)
Regards,
Erwin Moller
>
>
> T. Wintershoven schrieb:
>> Hi Shelly,
>>
>> Thanks for your reaction.
>>
>> When i do a header(location), i get an error message:
>> Warning: Cannot modify header information - headers already sent.
>>
>> The header is allready sent on the second line ... session_start() ...
>> (see code)
>>
>> Tino
>>
>>
>>
>> "Shelly" <sheldonlg.news@asap-consult.com> wrote in message
>> news:9AVah.4038$sf5.623@newsread4.news.pas.earthlink.net...
>>
>>>"T. Wintershoven" <twintershoven@casema.nl> wrote in message
>>>news:raqdnVvftoLyvfHYnZ2dnUVZ8tSdnZ2d@casema.nl...
>>>
>>>>Hi all,
>>>>
>>>>Is there a simple way in php to reload a page coded within an if
>>>>statement.(see code below)
>>>>It's very important that the session stays intact.
>>>>The filename is RCStudent.php
>>>>
>>>>**************** A peace of code***************************
>>>><?php
>>>> session_start();
>>>>?>
>>>>
>>>>if($_POST['ST']!='')
>>>>{
>>>> $_SESSION['nScreen']=2'';
>>>>}
>>>>elseif ($_POST['AT']!='')
>>>>{
>>>> $_SESSION['nScreen']=0'';
>>>>
>>>> *** RELOAD CODE HERE ***
>>>>}
>>>>
>>>>******************* End code*******************************
>>>
>>>Do a header("Location: this_page_with_appropiate_parameter_passing"); ?
>>>
>>>Shelly
>>>
>>>
>>
>>
>>
>
> --
> CB
Navigation:
[Reply to this message]
|