{Semi-Resolved} MyBB 'Variable Scope' 101
Firefox Wins Offline
Member
***
Posts: 164
Joined: Mar 2008
Post: #1
{Semi-Resolved} MyBB 'Variable Scope' 101
Variable Scope may not be the exact term, but the idea is similar.

This doesn't work:*

PHP Code:
define("IN_MYBB", 1);
require_once "./global.php";

// include file *after*  define("IN_MYBB...
require_once "./inc/var/example2.php";


*The variables in './inc/var/example2.php', are not set or available.

This works:*

PHP Code:
// include file before  define("IN_MYBB...
require_once "./inc/var/example2.php";

define("IN_MYBB", 1);
require_once "./global.php";


*The variables in './inc/var/example2.php', are set and available to use.

A) None of the variables in 'example2.php' conflict with MyBB standard vars.
B) The 'disappearing vars' are *not* being used inside a function.
C) How come 'they' cannot be included*** after  define("IN_MYBB", 1);  ?

***I'm certain the above is true in at least one case, any idea why?
Thanks for advice.

(This post was last modified: 09-24-2010 01:21 PM by Firefox Wins.)
09-20-2010 01:32 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
{Semi-Resolved} MyBB 'Variable Scope' 101 - Firefox Wins - 09-20-2010 01:32 PM

 Standard Tools
Forum Jump: