Jump to content


Photo

Cannot send session cache limiter - headers already sent


  • Please log in to reply
1 reply to this topic

#1 Mutley

Mutley
  • Members
  • PipPipPip
  • Advanced Member
  • 765 posts

Posted 25 September 2006 - 02:49 PM

I tried to do a simple include, to have my forum (SMF) included on my website.

Unfortunatly I just get:
session_start() [function.session-start]: Cannot send session cache limiter - headers already sent

I thought this was due to spaces after/before the PHP tags but I can't see any.
My forum.php is just 7 lines including everything:
<?php
$title = "Forum";
$sideplans = "no";
include('inc/header.php');
include('forum/index.php');
include('inc/footer.php');
?>


Any ideas?
~ Mutley.

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 25 September 2006 - 02:52 PM

Due to the nature of what you're doing. You'll want to use output buffering. So add ob_start(); before the opening php tag and ob_end_flush(); before the closing php tag. So your code should now be like this:
<?php
ob_start();

$title = "Forum";
$sideplans = "no";
include('inc/header.php');
include('forum/index.php');
include('inc/footer.php');

ob_end_flush();
?>





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users