Session extracted from PhpBB
Posted: Wed Jun 16, 2004 10:14 pm
What is wrong with this program? It worked fine in one folder, however, I moved it over to another folder and -blam- it won't work.
Now, even when I have it echo $username or any of the variables right inside that same script, it won't work. No userdata is being included. What did I inadvertantly change?

Code: Select all
<?PHP
define('IN_PHPBB', true);
$site_root_path = '/home/yolegoma/public_html/';
$phpbb_root_path2 = '.monkeyslair/';
$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);
$loggedin = $userdata['session_logged_in'];
$username = $userdata['username'];
$uservisit = $userdata['user_lastvisit'];
$useremail = $userdata['user_email'];
$userwebsite = $userdata['user_website'];
// $new_post = the number of posts since last visit
$sql = "SELECT * FROM monkey_posts WHERE post_time >= $uservisit";
$result = mysql_query($sql);
$new_post = "0";
while($row = mysql_fetch_array($result)) {
$new_post = $new_post + 1;
?>