Page 1 of 1

Session extracted from PhpBB

Posted: Wed Jun 16, 2004 10:14 pm
by The Monkey
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.

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;
                        ?>
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?

:(

Posted: Thu Jun 17, 2004 2:03 am
by phice

Code: Select all

$phpbb_root_path2 = '.monkeyslair/';
unless the folder is named '.monkeyslair' (with the leading period (.), then it should be:

Code: Select all

$phpbb_root_path2 = 'monkeyslair/';

Posted: Thu Jun 17, 2004 2:20 am
by d3ad1ysp0rk
or

Code: Select all

$phpbb_root_path2 = './monkeyslair/';
:P

Posted: Thu Jun 17, 2004 8:13 am
by The Monkey
*embarrased look* That was merely a typo, the script I am using has the / instead of the . I'm very sorry.

However, I'm not sure what the problem is. I simply COPIED this script from /redesign to /newredesign, and it quit working. I dislike programming sometimes.

*sigh*

Posted: Thu Jun 17, 2004 11:18 am
by feyd
maybe you have some other dependancy on /redesign ?

Posted: Thu Jun 17, 2004 4:50 pm
by The Monkey
The problem lied in the fact that I was, in this case of header.php, including all of the url:, I.E, http://www.mysite.com/newredesign/inclu ... ession.php. Simply removing the http://www.mysite.com/newredesign/ fixed the problem.

However, I need the full url for when my scripts lie in subdomains, which will be the case in two occasions. How do I work around this problem?