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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.