Hi Michael,

session_start(); must be the very first line of code on the page, with no 
whitespaces trailing, else you'll get the 'header already sent' message:

<?php session_start(); ?>

Hth,
Andre

On Monday 12 July 2004 10:40 am, Michael Purdy 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

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

Reply via email to