Fulla
06-15-2008, 10:48 AM
Integrating Vbulletin functions into my website is causing me problems.
If I include the following in my script:
<?php
//Begin Define $rootdir
$times=substr_count($_SERVER['PHP_SELF'],'/');
$rootdir='';
$x=1;
while ($x < $times) {$rootdir .= "../";$x++;}
$GLOBALS['rootdir']=$rootdir;
//End Define $rootdir
define('DIR',$rootdir.'board/');
define('CWD',$rootdir.'board/');
require_once(DIR.'global.php'); //these 4 files all (also separate) cause this problem
require_once(DIR.'includes/functions_bigthree.php'); //these 4 files all (also separate) cause this problem
require_once(DIR.'includes/class_postbit.php'); //these 4 files all (also separate) cause this problem
require_once(DIR.'includes/class_bbcode.php'); //these 4 files all (also separate) cause this problem
?>
Once I require a file from Vbulletin, all my vars are wiped.
If I open the page as followed: myfile.php?page=test
Then the following scripts give the following response
<?php
$pagina=$_GET['page']
echo $pagina; //test
//vbinclude
echo $pagina; //empty
?>
<?php
$pagina='about';
$pagina=$_GET['page'};
echo $pagina; //test
//vbinclude
echo $pagina; // empty
?>
<?php
$pagina='about';
echo $pagina; //about
//vbinclude
echo $pagina; //about
?>
So it doesnt really wipe out the $vars, altho vars filled with $_GETs are wiped.
What is causing this, and how can I solve this?
I put this in my php.ini: register_globals = off
thx for any help
If I include the following in my script:
<?php
//Begin Define $rootdir
$times=substr_count($_SERVER['PHP_SELF'],'/');
$rootdir='';
$x=1;
while ($x < $times) {$rootdir .= "../";$x++;}
$GLOBALS['rootdir']=$rootdir;
//End Define $rootdir
define('DIR',$rootdir.'board/');
define('CWD',$rootdir.'board/');
require_once(DIR.'global.php'); //these 4 files all (also separate) cause this problem
require_once(DIR.'includes/functions_bigthree.php'); //these 4 files all (also separate) cause this problem
require_once(DIR.'includes/class_postbit.php'); //these 4 files all (also separate) cause this problem
require_once(DIR.'includes/class_bbcode.php'); //these 4 files all (also separate) cause this problem
?>
Once I require a file from Vbulletin, all my vars are wiped.
If I open the page as followed: myfile.php?page=test
Then the following scripts give the following response
<?php
$pagina=$_GET['page']
echo $pagina; //test
//vbinclude
echo $pagina; //empty
?>
<?php
$pagina='about';
$pagina=$_GET['page'};
echo $pagina; //test
//vbinclude
echo $pagina; // empty
?>
<?php
$pagina='about';
echo $pagina; //about
//vbinclude
echo $pagina; //about
?>
So it doesnt really wipe out the $vars, altho vars filled with $_GETs are wiped.
What is causing this, and how can I solve this?
I put this in my php.ini: register_globals = off
thx for any help