SLG Posted October 30, 2006 Share Posted October 30, 2006 Hey all,I am a bit noob to PHP/MySQL (I just started a few weeks ago). Anyway, I am a webmaster for the site AlbinoShades, and I am about to release the new version of the site soon. This new site has a login feature that was a serious pain in the ass to get working. Well I finnaly got everything up and running, and started intergrating the script into the site, then this ugly error appeared at the top saying:[code]Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/albinosh/public_html/rc2/home.php:5) in /home/albinosh/public_html/rc2/include/session.php on line 47[/code]But then everything else worked, I could login, password protect pages, edit admin settings etc. So I looked at line 47 in sessions.php and saw this line:[code]start_session()[/code]I knew that editing this would screw up the script, but I couldnt resist, I commented that line, then the ugly error went away, but I couldn't login. So I un-commented that line, and same thing happens. Any ideas why this error message is showing? Link to comment https://forums.phpfreaks.com/topic/25634-quick-question-solved/ Share on other sites More sharing options...
jwk811 Posted October 30, 2006 Share Posted October 30, 2006 start_session() has to be at the very top of any script in order for it to work or you will get errors like that.. so right at the top of the script before anything put:[code]<?phpstart_session()?>[/code]let me know if it works after this.. Link to comment https://forums.phpfreaks.com/topic/25634-quick-question-solved/#findComment-116993 Share on other sites More sharing options...
Caesar Posted October 30, 2006 Share Posted October 30, 2006 You want to make sure that therer are no blank lines before "session_start()" and that is the first thing on the page. Also...[code]<?php session_start(); ob_start();?>[/code]Sometimes adding the ob_start() function can address [i]other[/i] header related issues. Link to comment https://forums.phpfreaks.com/topic/25634-quick-question-solved/#findComment-116994 Share on other sites More sharing options...
SLG Posted October 30, 2006 Author Share Posted October 30, 2006 so would I put[code] session_start(); ob_start();[/code]on the top of home.php or sessions.php? Link to comment https://forums.phpfreaks.com/topic/25634-quick-question-solved/#findComment-116995 Share on other sites More sharing options...
SLG Posted October 30, 2006 Author Share Posted October 30, 2006 Never mind I got it! The ob_start(); did the trick! Thank you all for the help! You guys rock! Link to comment https://forums.phpfreaks.com/topic/25634-quick-question-solved/#findComment-116997 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.