Jump to content

Cannot send session cache limiter - headers already sent


Mutley

Recommended Posts

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

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

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:
[code]<?php
$title = "Forum";
$sideplans = "no";
include('inc/header.php');
include('forum/index.php');
include('inc/footer.php');
?>[/code]


Any ideas?
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:
[code=php:0]<?php
ob_start();

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

ob_end_flush();
?>[/code]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.