phpBB Login Integration Problem

I’ve been working off this tutorial http://www.phpbbhacks.com/forums/viewtopic.php?t=4968 in order to make my website’s login be integrated with the phpBB login that I use on my forum. However, I cannot get further than the piece of code I put into the header of my index.php file:
[php]
define(‘IN_PHPBB’, true);

$site_root_path = ‘/home/teenbite/public_html/’; //<-- Modify
$phpbb_root_path2 = ‘forum/’; //<-- Modify
$phpbb_root_path = $site_root_path . $phpbb_root_path2;
include($phpbb_root_path . ‘extension.inc’);
include($phpbb_root_path . ‘common.php’);

$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);[/php]

It simply exits the rest of the page.

??? - I don’t understand what your question is?

I would like to know how to make that piece of code work.

Ok. I realised I had the code inside the Title tags, so I’ve moved it out (still inside the header though), and I get this error:

Warning: Cannot modify header information - headers already sent by (output started at /home/teenbite/public_html/index.php:8) in /home/teenbite/public_html/forum/includes/sessions.php on line 182

Warning: Cannot modify header information - headers already sent by (output started at /home/teenbite/public_html/index.php:8) in /home/teenbite/public_html/forum/includes/sessions.php on line 183

Line 182 and 183 of the offending file:
[php] setcookie($cookiename . ‘_data’, serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);
setcookie($cookiename . ‘_sid’, $session_id, 0, $cookiepath, $cookiedomain, $cookiesecure);[/php]

header information can not be changed after the page is already sent. To change header informtion it has to be the FIRST information sent (before html).

Thankyou so much! You are the only person on 6 different PHP forums that would help me! Is there anywhere I can put in a good word for you?

You probably could have found the answer at each one of those 6 PHP forums just by searching around for something like “header information”. No offense but it’s a quite common question…

KingSwing - :) - Good luck

Sponsor our Newsletter | Privacy Policy | Terms of Service