![]() |
Dir in forum directory (getting global.php stuff)
If i have a directory in my forum directory like so:
forums/mydir And i want to include global.php from the forums directory and use its values in my index.php in mydir what code do I use. I've tried using chdir but to no effect. Any ideas on how I can get it :)? - miSt |
PHP Code:
|
PHP Code:
|
Does that give you an error? It should if it can't include it (may have to comment out the error reporting line to see)...
Perhaps ../forum/config.php ? if not... you may need to use the real path - ie /home/users/public_html/forum/ |
Using the full path wont work, i've tried it (many times)
|
Try combinations of chdir'ing and then require'ing. :)
|
/forums/mydir
|
Quote:
I meant the real server path... not http://www.example.com/forum/config.php because more than likely it will give you a seeking not allowed error in that case ;) |
Make a directory in your forums directory called 'moo'.
Then upload this as your index.php file: PHP Code:
I see nothing :( |
Ah I see what it's doing. It is trying to include ./admin/config.php relative to the /forum/folder/ directory... not sure if I have a solution for that unless you just copy paste the global.php file into your new directory and alter the line where it includes config.php to point.
|
The simplest way would be to create a symlink in moo to global.php and to forums/admin.
Or: PHP Code:
|
So i put that line before requiring global.php right? ^^
|
I don't know if that will work, but worth a shot.
I thought changing the include path would work, (ie ini_set('include_path', '.:/path/to/script/here/'); but on *nix boxes apparently is doesn't work with files included within an include. :( |
$vbpath ="/path/to/folder/with/global/in/it";
chdir($vbpath); require_once("global.php"); or like NTLDR said |
All times are GMT. The time now is 07:41 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|