> When I run main.html, I get the following error message :
> Warning : Cannot send session cookie - headers already sent by (output
> started at /var/www/html/main.html: 10) in /var/www/html/main.html on
> line 11

> Where could I be wrong ?
>
> Raju

You must make sure that in pages where you use cookies that you do not have
any 'output' before the point where your cookies are set. Output includes
whitespace and blank lines.

Thus:

--------------------------- <- beginning of file
<?
   session_start();
   ...
   ...
?>

would be fine. But:


--------------------------- <- beginning of file

<?
   session_start();
   ...
   ...
?>

would not work because there is a blank line between the beginning of the
file and the place where you actually set the cookie -- session_start();.

This of course applies to any included files as well.

regards
--
Jason Wong
Gremlins Associates
www.gremlins.com.hk




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to