Ok, so I have an interface page with all the forms and everything and I have an include file that contains all the functions I use on the interface.
I also have a session variable created called privilegeID when the user logs into the site and accesses the interface.
I can call the privilegeID variable from the interface, and from the include file as long as the call is outside of a function... once I make the call inside a function it doesn't work...
To get around this I did this:
global $privilegeID
function whatever() {
$privilegeID = $GLOBALS['privilegeID'];
}
This does work, but it seems rediculous that I should have to declare variables this way at the beginning of each function - especially since I have lots of functions and may change the way I handle privileges very soon...
Is there a way I can have the functions automatically recognize the priviligeID variable? I always thought that functions recognized globals without having to declare them first... but I haven't used globals that much so I guess I'm wrong...
Thanks,
Ben