Capslock Posted November 6, 2008 Share Posted November 6, 2008 I edited some of the address to protect my project I looked online for answers and all im seeing is "it's because of white spaces" I have checked both my php on the mother page, and on the page to include. I can't find any spaces inside or outside the php that shouldn't be there. This is what im getting.. Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/marauder/public_html/trial3/securetop.php:8 ) in /home/marauder/public_html/trial3/securetop.php on line 9 Can anyone help? (Had to add the space at the end of the first address, the 8 and ) where creating a smilie) Link to comment https://forums.phpfreaks.com/topic/131707-solved-im-getting-a-warning-kind-of-new-to-this-stuff/ Share on other sites More sharing options...
corbin Posted November 6, 2008 Share Posted November 6, 2008 http://www.phpfreaks.com/forums/index.php/topic,37442.0.html Link to comment https://forums.phpfreaks.com/topic/131707-solved-im-getting-a-warning-kind-of-new-to-this-stuff/#findComment-684156 Share on other sites More sharing options...
Capslock Posted November 7, 2008 Author Share Posted November 7, 2008 I have searched for white spaces, and nothing is showing up, is there a recommended encoding to edit the file in when working on it? Or will notepad not display white spaces? The thread you directed me to isn't helping. Link to comment https://forums.phpfreaks.com/topic/131707-solved-im-getting-a-warning-kind-of-new-to-this-stuff/#findComment-684263 Share on other sites More sharing options...
dezkit Posted November 7, 2008 Share Posted November 7, 2008 session_start(); should always be on the first line after <?php or on the second like after <?php e.g. <?php session_start(); ?> Link to comment https://forums.phpfreaks.com/topic/131707-solved-im-getting-a-warning-kind-of-new-to-this-stuff/#findComment-684270 Share on other sites More sharing options...
trq Posted November 7, 2008 Share Posted November 7, 2008 session_start(); should always be on the first line after <?php or on the second like after <?php e.g. <?php session_start(); ?> This is a fallacy. session_start() can go anywhere, it just must be prior to output being sent. Link to comment https://forums.phpfreaks.com/topic/131707-solved-im-getting-a-warning-kind-of-new-to-this-stuff/#findComment-684271 Share on other sites More sharing options...
Capslock Posted November 7, 2008 Author Share Posted November 7, 2008 i fixed it, for some reason the opening html code was conflicting, i moved my header, body, title etc tags below the php script i was trying to run. Link to comment https://forums.phpfreaks.com/topic/131707-solved-im-getting-a-warning-kind-of-new-to-this-stuff/#findComment-684291 Share on other sites More sharing options...
Rsmiley Posted November 7, 2008 Share Posted November 7, 2008 i fixed it, for some reason the opening html code was conflicting, i moved my header, body, title etc tags below the php script i was trying to run. That happened to me as well. I ended up moving everything around Click topic Solved Link to comment https://forums.phpfreaks.com/topic/131707-solved-im-getting-a-warning-kind-of-new-to-this-stuff/#findComment-684293 Share on other sites More sharing options...
corbin Posted November 7, 2008 Share Posted November 7, 2008 There's a reason why it happened. The HTTP protocol's basic layout is: HEADERS HERE CONTENT HERE So if content has already been sent to the client, how is it possible to go back and send a header? (session_start() sends a cookie header, since cookies are how clients are ID'd with sessions.) It's not just some weird problem people get, like it sounds like y'all are making it out to be. Link to comment https://forums.phpfreaks.com/topic/131707-solved-im-getting-a-warning-kind-of-new-to-this-stuff/#findComment-684319 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.