PDA

View Full Version : Location in session table


becafuel
03-12-2007, 11:30 AM
Hi,

I was creating some web pages outside of vBulletin and wanted them to appear in the WOL page.
Not that hard, since I only had to include global.php and eventually create a module to display "correct" names on WOL. And it's working.

But... things went wrong when I sent the pages on my ISP :( Location was not showing anymore, but instead was showing 'viewing index' when on forum at the same time or not showing at all if the pages were located outside of vBulletin directory (which of course will often be the case).

If debug is active, I can see that $filename is empty when page is outside of vb directory.
In the session table, location is : "/forum/" while it should be "/forum/myfile.php" or something like that.

The differences between me and my ISP are :
apache2.2.3, php5.1.6, mysql5.0.27, Linux 2.6.18 for me
apache (no version indication), php4.4.4, mysql4.1.20, Linux 2.6.17 for ISP


So my question is : what can cause my problem ? apache ? php ? And of course, how can I get around this ? ;)

Any help is welcome.

Marco van Herwaarden
03-12-2007, 11:54 AM
Make sure you have a line like (before including global.php):
define('THIS_SCRIPT', 'myfile');

becafuel
03-12-2007, 12:28 PM
I have this line :(

I've been waiting a bit to answer in order to leave cookies go away, so I won't get spoiled by them.
Here's what is going on now, with this code :define('THIS_SCRIPT', 'test01');
chdir ('./forum');
require_once ('./global.php');
chdir ('..');

echo "Test page<br />";
echo "#".$_SERVER['SCRIPT_URL']."#";
echo "<br />";
echo "#".$_SERVER['REQUEST_URI']."#";

This test page is located one directory below the vb one (hence the chdir())

On the ISP side, I get :Test page
#/test01.php#
#/test01.php#
And nothing in the session table.

On local side :
Test page
##
#/test01.php#
and /test01.php in the location field of the session table.

Both environment are not giving the same results, as you can see :cool:

Marco van Herwaarden
03-12-2007, 01:06 PM
The above only means that the webserver on your localhost, does not set a $_SERVER['SCRIPT_URL']."#";

becafuel
03-12-2007, 01:09 PM
Not only ;)
On localhost, /test01.php is in session table; not on ISP...

So...

I've asked my ISP to migrate one of my accounts to PHP 5.1.5 & MySQL 5.0.22 and then I have installed a copy of vB on it (yes, I know it's illegal, but I will delete it, don't worry) .
Same test page but this time : good results on WOL page and $filename contains the correct file name.
Apache server is still the same.

So it appears that my problem is related to the version of PHP running on the server.