newclear Posted September 29, 2011 Posted September 29, 2011 Hey guys.. I have a small problem.. At top of every page this error gets showed: Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/andersen/public_html/login/index.php:10) in /home/andersen/public_html/login/globals.php on line 2 The line the error code is showing is this: session_start(); Anyone able to help out? Quote
gurpreet Posted September 29, 2011 Posted September 29, 2011 It means that another page has already got session_start(); in it. For example say your globals has it and you have this in a page: <?php include "globals.php"; session_start(); blah blah That will try to send out 2 session starts because 1 is in your globals. Quote
bluegman991 Posted September 29, 2011 Posted September 29, 2011 It doesn't always mean he has 2 session starts. It could also mean that he has in echo, print, header, or another function that outputs something to the page written somewhere after the session start. put ob_start(); before everything on the main page which has the includes, and that should fix it. If not tell us what you have on line 10 in publichtml/login/index.php. And what you have on line 2 of login/globals.php. Quote
sniko Posted September 30, 2011 Posted September 30, 2011 I've also noticed, if you have white-space at the top of the file, it will throw this error Quote
newclear Posted October 3, 2011 Author Posted October 3, 2011 I got it fixed.. Im so embarrased i didnt notice myself.. But ron the line above include "header.php" i had wrote include "style.css"..lol Thanks anyways guys, i got it fixed :) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.