southbeach
Programmer
OK, I have the following:
index.php which includes a script where a class is defined. Class is called appVars and it is initialized as $appVars=new appVars.
As a condition, if user has not logged on, he/she will be taken to a log on form. index.php also includes other scripts where UDFs are defined and are used for opening databases and executing queries.
One of the UDF is used by XAJAX to validate user ID and Password via AJAX. So, the login form calls JS which in turn calls XAJAX PHP function passing user ID and password as parameters.
As part of the index.php script, if $appVar->appTitle has not been set, the class instance is declared and initiated. The UDF where user ID is validated attempts to use variables which are set within the class: $appVars->dbName, $appVars->dbUser, $appVars->dbPwd, $appVars->dbServer, etc.
The problem is that they are all blank ...
I really thought that once an instance of a class is set, all variables set through this class are basically global and can be referenced as $class_instance->variable
Where am I mistaken? What am I doing wrong?
Thank you all in advance for your assistance!
index.php which includes a script where a class is defined. Class is called appVars and it is initialized as $appVars=new appVars.
As a condition, if user has not logged on, he/she will be taken to a log on form. index.php also includes other scripts where UDFs are defined and are used for opening databases and executing queries.
One of the UDF is used by XAJAX to validate user ID and Password via AJAX. So, the login form calls JS which in turn calls XAJAX PHP function passing user ID and password as parameters.
As part of the index.php script, if $appVar->appTitle has not been set, the class instance is declared and initiated. The UDF where user ID is validated attempts to use variables which are set within the class: $appVars->dbName, $appVars->dbUser, $appVars->dbPwd, $appVars->dbServer, etc.
The problem is that they are all blank ...
I really thought that once an instance of a class is set, all variables set through this class are basically global and can be referenced as $class_instance->variable
Where am I mistaken? What am I doing wrong?
Thank you all in advance for your assistance!