Can't pass varables

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gumphfy
Forum Newbie
Posts: 23
Joined: Fri Jan 06, 2006 10:18 am

Can't pass varables

Post 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!
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Read up about Register Globals, then change $name to $_GET['name'].
gumphfy
Forum Newbie
Posts: 23
Joined: Fri Jan 06, 2006 10:18 am

Post by gumphfy »

Thanks! Just what I needed...seems like I've got some reading to do ^^
Post Reply