PHPBB External Login Issue

Hi all,

I am wanting to have an auto-login for my forum and im developing my site in php i am using a board called phpbb but when i try to intergrate the api i get this displayed

[phpBB Debug] PHP Warning: in file /includes/session.php on line 1035: Cannot modify header information - headers already sent by (output started at /home/willbcco/domains/willbc.net/public_html/bccms/functions.php:932)
[phpBB Debug] PHP Warning: in file /includes/session.php on line 1035: Cannot modify header information - headers already sent by (output started at /home/willbcco/domains/willbc.net/public_html/bccms/functions.php:932)
[phpBB Debug] PHP Warning: in file /includes/session.php on line 1035: Cannot modify header information - headers already sent by (output started at /home/willbcco/domains/willbc.net/public_html/bccms/functions.php:932)

but on line 932 i have this function


function template()
{
	//
	
	include("dbconnect.php");
	$e="SELECT * FROM clansettings";
	$rs=mysqli_query($con,$e);
	$nwm="";
	if(!$rs)
	{
		$nwm.="Error:".mysqli_error($con);
	}
	else
	{
		$count=$rs->num_rows;
		if($count>0)
		{
			//
			while($data=$rs->fetch_assoc())
			{
				$nwoerr=$data['nwoerr'];
				$mpplay=$data['mpplay'];
			}
		}
	}
	//
	include("dbconnect.php");
	$kQuery="SELECT * FROM template Where selected='1'";
	$rs=mysqli_query($con,$kQuery);
	if(!$rs)
	{
		echo "Error:".mysqli_error($con);
	}
	else
	{
		$count=mysqli_num_rows($rs);
		if($count>0)
		{
			$data=mysqli_fetch_assoc($rs);
			extract($data);
			AutoLogout();
			$Header=stripslashes($Header);
			$Login=LoginhtmlCheck();
			$genav=newmem($nwoerr);
			$ge=musicplayer($mpplay);
			$dpclan=dpclan($cssclan);
			$aPlaceholders = array('[newmemb]','[musicplayer]','[dpclan]','[loginForm]');
			$aReplacements = array($genav,$ge,$dpclan,$Login);
			echo str_replace($aPlaceholders, $aReplacements, $Header);
			//
		}
		else
		{
			echo " Error:The Header you are Looking for cannot be found";
		}
	}
	
}

Which is the echo statement i know that echo prints it on the page so what am i doing wrong even if the echo statement above is causing the problem? why is it acting like that?

Thanks,William

Did you try using ob_start() at the very beginning of your script to turn on output buffering [URL=“http://no2.php.net/manual/en/function.ob-end-flush.php”]then ob_end_flush() to send the content to the browser? Usually when you get “headers already sent” errors that will solve the problem.

Somewhere in your script you are outputting something before all the header functions have been called. I cannot see where this is happening based on the small snippet of code you provided. Buffering output will solve that problem.