I have a php file (oops.php) that calls in "mma-config.php" which contains...
global $sERROR_NO_CONN = "Error connecting to database. Check back later";
global $sERROR_NO_ACCESS = "You are not authorized to access this area.";
global $sERROR_ADD = "An error was encountered adding the record";
global $sERROR_MODIFY = "An error was encountered modifying the record.";
Inside oops.php, I call mma-config.php and want to reference the error message - example:
$_SESSION['error'] = ERROR_NO_CONN;
However when the oops php page is displayed, instead of the error message, it displays "ERROR_NO_CONN";
I did check in the oops.php page that I called in the mma-config.php script
Can't figure out what the problem is.
Do you have any additional code that you can post? It's hard to determine scoping without seeing the full context.
It looks like you might have the wrong idea about the global keyword from what you have posted though. Using the global keyword when declaring variables should result in a parse error (http://codepad.org/uygSzPAW)