Viewing topic:errors
Page: 1
Topic post 21-07-2008 - 21:01
i get errors on my website @ http://sthelensclubberz.co.uk/login.php which are

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/sites/sthelensclubberz.co.uk/public_html/login.php:8) in /home/sites/sthelensclubberz.co.uk/public_html/login.php on line 95

and when i go to the userpanel with my username and password it comes up with this error

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/sites/sthelensclubberz.co.uk/public_html/userpanel.php:8) in /home/sites/sthelensclubberz.co.uk/public_html/userpanel.php on line 94

Topic post 22-07-2008 - 11:04
Hehe, you can actually find the problem in the error itself: Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/sites/sthelensclubberz.co.uk/public_html/login.php:8) in /home/sites/sthelensclubberz.co.uk/public_html/login.php on line 95

This means that you prob. have session_start() at line 95 right? Well, thats wrong, you have to do session_start at the begin of the page. Or better said, you have to start the session before you output ANYTHING so even a space.

This is because the HTTP protocol has information headers. You don't just receive the html from the server and that's it, you also recieve much extra information via header including a cookie that is the session_id.

The headers are always at the begin of the file, when some output is found it closes the headers and begins with the html page. So when you try to start the session with session_start and you already have sent some output, you are trying to add a header but thats not possible because the headers are already sent.

So just place session_start at the top of the file and it will work just fine

©Copyrights Combined Minds. All rights reserved 2006 - 2008 : Disclaimer
Realized by www.Minna-Media.com