oohoohoohooh
Programmer
Hi, I was wondering how to get the global value of a defined constant from within a class. Say I have (within a function inside a class that is called):
echo X_ADMIN ? '<br /><a href="admin.php">Admin Panel</a>' : '';
The constant is defined by:
if($self['status'] == 'Administrator') {
define('X_ADMIN', true);
} else {
define('X_ADMIN', false);
}
earlier in the script.
I thought they would work fine but when I run the script I got the error:
PHP Parse error: syntax error, unexpected ';' in C:\Inetpub\ on line 3
I'd appreciate if you could help. Thanks
echo X_ADMIN ? '<br /><a href="admin.php">Admin Panel</a>' : '';
The constant is defined by:
if($self['status'] == 'Administrator') {
define('X_ADMIN', true);
} else {
define('X_ADMIN', false);
}
earlier in the script.
I thought they would work fine but when I run the script I got the error:
PHP Parse error: syntax error, unexpected ';' in C:\Inetpub\ on line 3
I'd appreciate if you could help. Thanks