Terry J Daichendt wrote:
> You have a real attitude problem, please don't bother with me again.
> 
> 
> "Jochem Maas" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> Terry J Daichendt schreef:
>>> I'm pasting this code from the example at php.net and getting these
>>
>> which example might that be, with 1000's of built in functions you
>> can imagine there is probably more than one.
>>
>>> errors. Can anyone determine what I'm doing wrong?
>>>
>>
>> yes. but can your read? the error message tells you what is wrong.
>>
>> "output started at
>> /home/terryswe/public_html/hisdailybread/session.php:6"
>>
>> basically the body of a http request must come after the http headers,
>> sessions make use of cookies. the first echo (or print) statement
>> effectively
>> starts the output of the http request body after which no headers can
>> be sent
>> anymore.
>>
>> what is also plainly obvious is that the example code you posted is *NOT*
>> the code your trying to run:
>>
>> there is no session_start() called on line 9 in the example you gave.
>>
>>> <?php
>>> // page1.php
>>>
>>> session_start();
>>>
>>> echo 'Welcome to page #1';
>>>
>>> $_SESSION['favcolor'] = 'green';
>>> $_SESSION['animal']   = 'cat';
>>> $_SESSION['time']     = time();
>>>
>>> // Works if session cookie was accepted
>>> echo '<br /><a href="page2.php">page 2</a>';
>>>
>>> // Or maybe pass along the session id, if needed
>>> echo '<br /><a href="page2.php?' . SID . '">page 2</a>';
>>
>> don't bother with the above line, it's shite. which is a
>> short way of saying that you have no idea as to the security
>> ramifications so best not to even go there.
>>
>>> ?>
>>>
>>>
>>> Warning: session_start() [function.session-start]: Cannot send
>>> session cookie - headers already sent by (output started at
>>> /home/terryswe/public_html/hisdailybread/session.php:6) in
>>> /home/terryswe/public_html/hisdailybread/session.php on line 9
>>>
>>> Warning: session_start() [function.session-start]: Cannot send
>>> session cache limiter - headers already sent (output started at
>>> /home/terryswe/public_html/hisdailybread/session.php:6) in
>>> /home/terryswe/public_html/hisdailybread/session.php on line 9
>>> Welcome to page #1
>>>
>>> Terry
>>>
>>>
>>
> 
> 

He was simply trying to point to the fact that you showing us something that
is different then what you trying to run that IS causing the problems.

And a side note:  the answer to your question,
                "Can anyone determine what I'm doing wrong?"

He told you that the answer to that question was in your own email.

        headers already sent

where

        in the file /home/terryswe/public_html/hisdailybread/session.php

        on line 6

Everything Jochem's said was facts based on the information that you gave us
in your original email.

My suggestion, remove your session_start() in the above example, because it is
causing the problem.

-- 
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
       and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
    by William Shakespeare


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to