PHP How-ToPost your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
[font=Andale Mono]Hi All,
I'm getting this error, when i try to compile the login.php file locally from my system. I'm giving the error message for your reference.
The warning displayed is
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at c:\Program Files\Apache Group\WEBS\Test\ML_Proj_Chn\login.php:10) in c:\Program Files\Apache Group\WEBS\Test\ML_Proj_Chn\login.php on line 44
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at c:\Program Files\Apache Group\WEBS\Test\ML_Proj_Chn\login.php:10) in c:\Program Files\Apache Group\WEBS\Test\ML_Proj_Chn\login.php on line 44
This is because session_start() needs to be the first line in your php file, as cookie based sessions need to be setup before anything else (even whitespace) is output into the browser.