1 (edited by color4o 2011-05-05 20:05)

Topic: cannot modify header information -headers already sent

Hey all,
I've trying to integrate punbb forums (which i found are the best by the way) into my own web site who has nothing to deal with any CMS.
I have that error:
warning: Cannot modify header information - headers already sent by (output started at MYWEB/index.php:7) in MYWEB/punbb/include/functions.php on line 152 --- AND THE SAME ERROR ON LINE 155

that lines are: function forum_setcookie
line 152: header('P3P: CP="CUR ADM"');
line 155: setcookie($name, $value, $expire, $cookie_path, $cookie_domain, $cookie_secure, true);

well i dont know where the error is.. i know headers can be send once and i can avoid that problem with headers_sent() function but is that ok? that was for line 152

well truly i dunno why setcookie give me header error.. (line 155)

this is happening only with logged users..

if someone can help me i will appreciate it!

Greetings!

Re: cannot modify header information -headers already sent

Its simple — your code send data BEFORE headers. Maybe its just few chars saved in file or something.

3 (edited by color4o 2011-05-06 11:03)

Re: cannot modify header information -headers already sent

this is my code

....
</head>
<body style="background-color:white;">
<?php 
define('FORUM_ROOT', './punbb/');
require FORUM_ROOT.'include/common.php';
...

i dont have anything before head tag except regular this (doctype html tag)

Re: cannot modify header information -headers already sent

oh i see now.. i need to put common.php at the very top of my page.

problem SOLVED..

please someone lock this topic