Hello,

        Do you have output buffering enabled in your php.ini file ?

--snip--
; Output buffering allows you to send header lines (including cookies) even
; after you send body content, at the price of slowing PHP's output layer a
; bit.  You can enable output buffering during runtime by calling the output
; buffering functions.  You can also enable output buffering for all files by
; setting this directive to On.  If you wish to limit the size of the buffer
; to a certain size - you can use a maximum number of bytes instead of 'On', as
; a value for this directive (e.g., output_buffering=4096).
output_buffering = 4096
--snip--

The "session_start()" does not have to be the first line of PHP code on the page if 
you have output buffering enabled.
But it should be near the top.

Michael.


On Tue, 13 Jul 2004 00:40:04 +1000
"Michael Purdy" <[EMAIL PROTECTED]> wrote:

> Folks
> 
> I am a new to php.  I am currently learning about session handling and would 
> appreciate some assistance with the
> following:
> 
> I am using php 4.3.7 and I am using the default values in the php.ini for
> 
> session.use_cookies = 1
> session.cache_limiter = nocache
> 
> When experimenting with a few simple lines of code
> 
>      <script language='php'>  ---- This is line 14
>        session_start();
>      </script>
> 
> I get the following errors:
> 
> Warning: session_start(): Cannot send session cookie - headers already sent by 
> (output started at
> e:\http\cgi\a.php:14) in e:\http\cgi\a.php on line 15
> 
> Warning: session_start(): Cannot send session cache limiter - headers already sent
> (output started at e:\http\cgi\a.php:14) in e:\http\cgi\a.php on line 15 
> 
> Can anyone offer me a insight on the reason for the error.
> 
> Mike
> 
> 
> 


-- 
Michael Gale
Network Administrator
Utilitran Corporation

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

Reply via email to