Solved: 11 Years, 7 Months, 4 Weeks ago Integrating MyBB login into website. (Problem)
#11
Solved: 11 Years, 7 Months, 4 Weeks ago
(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.
#12
Solved: 11 Years, 7 Months, 4 Weeks ago
No problem. Glad I could helpBig Grin
#13
Solved: 11 Years, 7 Months, 4 Weeks ago
What about creating a new page and including the file into your current ones?
[Image: tss-sig]
HELP
If you use Internet Explorer, you're in danger, using the least secure browser! Save your computer by installing Mozilla Firefox.
#14
Solved: 11 Years, 7 Months, 4 Weeks ago
(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.
#15
Solved: 11 Years, 7 Months, 4 Weeks ago
The only thing I can think of is just using:
require_once "mybb/global.php";
or whatever that file is..
#16
Solved: 11 Years, 7 Months, 4 Weeks ago
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.
[Image: tss-sig]
HELP
If you use Internet Explorer, you're in danger, using the least secure browser! Save your computer by installing Mozilla Firefox.
#17
Solved: 11 Years, 7 Months, 4 Weeks ago
(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/
#18
Solved: 11 Years, 7 Months, 4 Weeks ago
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.
#19
Solved: 11 Years, 7 Months, 4 Weeks ago
No problem. Glad I could helpSmile


Forum Jump:


Users browsing this thread: 1 Guest(s)