MyBB Community Forums

Full Version: Integrating MyBB login into website. (Problem)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
(2009-01-18, 03:56 AM)TomL Wrote: [ -> ]You can try doing, and replacing PAGE_NAME.PHP with the current page:
$dir = str_replace($_SERVER['PHP_SELF'], "PAGE_NAME.PHP", $_SERVER['PHP_SELF']);
chdir($dir);

Not sure if it'll work, but it's worth a try.:p

Nah, that didn't work, lol. Oh well. I'll just have to edit the code for each page. Thanks a lot for your help.
No problem. Glad I could helpBig Grin
What about creating a new page and including the file into your current ones?
(2009-01-18, 04:19 AM)Cultred Wrote: [ -> ]What about creating a new page and including the file into your current ones?

But what chdir code would I put on that new page that would work for all current pages? The chdir code needs to be different depending on where the file is located.

../ does work TomL, btw.
The only thing I can think of is just using:
require_once "mybb/global.php";
or whatever that file is..
What about full relative path? For example /public_html/mybb/global.php or however your server works (ex it can also be /www/domain/htdocs/blah/blah) Just try lots of them or have a different path on every page.
(2009-01-18, 04:49 AM)Cultred Wrote: [ -> ]What about full relative path? For example /public_html/mybb/global.php or however your server works (ex it can also be /www/domain/htdocs/blah/blah) Just try lots of them or have a different path on every page.
I don't recommend using relative paths, simply because it's better to just go from where you are. Especially since most websites read from where you are.

Examples:
You're in | You Enter.. | Equals(if you do chdir(dirName))
htdocs/ mybb/ htdocs/mybb/
htdocs/mybb/ lol/ htdocs/mybb/lol/
Eh, doesn't matter. I just added the code to each page and made it different depending on where the page was located. So, it's all working now. Thanks for your help, everyone.
No problem. Glad I could helpSmile
Pages: 1 2