I've had this problem before before with no real resolution. It's happening again so I'm hoping you experts can help.
I set a variable on my index.php based on the $_GET array. So I use this code:
$admin = isset($_GET['admin']) ? $_GET['admin'] : "dashboard";
Below that, I use a function to include my layout:
include_layout("admin_header.php");
which calls this function:
function include_layout($template="") {
include(SITE_ROOT.DS.'layouts'.DS.$template);
}
So far, so good, everything works. But if I try to echo the $admin variable from within the admin_header.php file, I get nothing. It's as if it's not set. I even test it by using echo $admin;
right before I include the header file, and it outputs there, but it's not set from the admin_header.php file's perspective.
Why would this happen? Is it something to do with using a function to include, rather than including it directly? And if so, WHY would that matter?
THANKS!!!!!!!!