Jump to content

Archived

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

Mutley

Cannot send session cache limiter - headers already sent

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?

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites

×

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.