Page 1 of 1

Can't pass varables

Posted: Tue Jan 17, 2006 12:10 pm
by gumphfy
I've been trying to integrate the PHPBB session with my own login for my site...so far so good, I've been able to keep the session alive throughout my site and the forum.
But in the process, I became unable to pass variables through my url. I have no idea of why...Because if I remove the PHPBB session addon I got, it all works fine.
I hope some of you can enlighten me a bit. Here are some of my code:

(Index.php)

Code: Select all

<?
session_start();
define('IN_PHPBB', true);  
$phpbb_root_path = './forum/';  
include($phpbb_root_path . 'extension.inc');  
include($phpbb_root_path . 'common.'.$phpEx); 

$userdata = session_pagestart($user_ip, PAGE_INDEX);  
init_userprefs($userdata); 

if( $userdata['session_logged_in'] )  
  {   
include('index2.'.$phpEx);
} else {
include('index2.'.$phpEx);
}
?>
(index2.php)

Code: Select all

<?
if (!defined('IN_PHPBB')) {
	die ("You can't access this file directly...");
}
define('MODULE_FILE', true);

require('int.config.php');

mysql_connect($server, $db_user, $db_pass);
mysql_select_db("$database");

include('temp/header.php');
include('temp/menu.php');
include('temp/side.php');
include('temp/main.php');
include('temp/footer.php');

?>
my header, menu, side and footer, are php scripts that fetches it's content from a sql DB, and they work fine.
My main.php is a switch function:

Code: Select all

<?
if (!defined('IN_PHPBB')) {
	die ("You can't access this file directly...");
}

switch ($name) {
case "news":
include 'lib/news/news.php';
break;

...etc...

default:
include 'lib/news/news.php';
}
?>
But the switch doesn't work, with the PHPBB addon apperantly...I'm blank, I've been at it for two days now, but I simply can't figure out why it doesn't work.
Hope some of you can!

Thanks in advance!

Posted: Tue Jan 17, 2006 12:43 pm
by Ambush Commander
Read up about Register Globals, then change $name to $_GET['name'].

Posted: Tue Jan 17, 2006 1:32 pm
by gumphfy
Thanks! Just what I needed...seems like I've got some reading to do ^^