News:

Wondering if this will always be free?  See why free is better.

Main Menu

Global Variables Across Classes

Started by ziycon, March 02, 2012, 05:13:14 AM

Previous topic - Next topic

ziycon

I'm trying to use a global variable across multiple classes, for example one class has:
global $logged_in;

if($logged_in)
  //your logged in
else
  //your not logged in


Then in the login class I have the below code:
global $logged_in;

if(//details are valid)
  $logged_in = true;
else
  $logged_in = false;


False always works but the 'true' value isn't being picked up even when set yo true!?

Any help greatly appreciated.

Advertisement: