Hey there all!
At the moment, i'm developing a small website. It's mainly static, but there are a few dynamic pages involved. I'm using phpBB as my forum and as my user database, so when someone is logged in on the forum, they're logged in to the entire site.
I have an overall header which seems to be hanging all the pages whenever I include it. It was working fine, then all of a sudden, it started. I don't think I changed anything, but here's the code anyway.. Just wondering if anyone had any insight into this..
<?php
session_start();
define('IN_PHPBB', true);
$phpbb_root_path = './forum/';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
if($userdata['session_logged_in'])
{
$userstate = "Welcome back, ".$userdata['username'].". Not you? <a href=\"/forum/login.php?logout=true&redirect=../login.php&sid=".$userdata['session_id']."\">Click Here</a>";
}
else
{
$userstate = "You are not logged in. <a href=\"login.php\">Log in</a> / <a href=\"signup.php\">Sign up</a>";
}
?>
Also, is this the best way to do it, or am I missing any security issues etc?
Thanks,
Dave