Hi I am trying to use this bit of code to make a login for a different area of a site which uses the same login as the PHPBB login. http://www.phpbb.com/kb/article/phpbb3-sessions-integration/ I got it to work on files in the root of the site, but want it to work on files in a folder named control-panel for example. The forum is in a folder named forum so had to add that into the code already for it to work but need some help on how to adjust this bit. <?php define('IN_PHPBB', true); $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './forum/'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.' . $phpEx); // Start session management $user->session_begin(); $auth->acl($user->data); $user->setup(); ?> <h1>Blah Blah Blah</h1> <?php if ($user->data['user_id'] == ANONYMOUS) { echo '<p>Please login!<p>'; } else { echo '<p>Thanks for logging in, ' . $user->data['username_clean'] . '</p>'; } ?> PHP: Comes up with the error carnt find file and the path has the control panel folder in it due to the way the php finds its file path.
try this code <?php define('IN_PHPBB', true); define('ROOT_PATH', "../forum"); //this is the folder where your phpBB3 installation is at... if (!defined('IN_PHPBB') || !defined('ROOT_PATH')) { exit(); } $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : ROOT_PATH . '/'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.' . $phpEx); // Start session management $user->session_begin(); $auth->acl($user->data); $user->setup(); ?> <h1>Blah Blah Blah</h1> <?php if ($user->data['user_id'] == ANONYMOUS) { echo '<p>Please login!<p>'; } else { echo '<p>Thanks for logging in, ' . $user->data['username_clean'] . '</p>'; } ?> PHP: