vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Location in session table (https://vborg.vbsupport.ru/showthread.php?t=141840)

becafuel 03-12-2007 11:30 AM

Location in session table
 
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):
PHP Code:

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 :
PHP 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 :
HTML Code:

Test page
#/test01.php#
#/test01.php#

And nothing in the session table.

On local side :
HTML Code:

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.


All times are GMT. The time now is 08:38 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01868 seconds
  • Memory Usage 1,720KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_html_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete