Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Global Constants

Status
Not open for further replies.

oohoohoohooh

Programmer
Apr 30, 2005
55
GB
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
 
Hi,

what are the lines 2 and 3 in index.tpl.php?

Regards,

c4n
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top