Re: why is it so?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Nayyar Ahmed wrote:
I am unable to understand when I execute etc.php, it give me the error
"Warning: session_start(): Cannot send session cache limiter - headers
already sent ....."

You need to have session_start() before _any_ output to the browser (such as HTML, spaces, newlines, etc). Sessions rely on cookies and the cookie must be set in the headers before any output.


<?php

any_php_code();

session_start();

any_other_php_code();

?>
<html>
  <body>...</body>
</html>

Also, this is better posted to php-general@xxxxxxxxxxxxx since it has nothing to do with databases.

--

---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux