Undefined Constant Assumed .... ERROR

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dfrancis
Forum Newbie
Posts: 1
Joined: Sun Jun 16, 2002 8:03 pm

Undefined Constant Assumed .... ERROR

Post by dfrancis »

When I enter the following:

if(CONSTANT_CONFIG == 1){
return;
}
define("CONSTANT_CONFIG",1);

I get the following error:

Notice: Use of undefined constant CONFIG_CONSTANT - assumed 'CONFIG_CONSTANT' in D:\sites\fileexchange\config.php on line 40
CONFIG_CONSTANT

Anyone with any help?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

you are refering to CONSTANT_CONFIG before it is defined. Of course you get 'Notice: Use of undefined constant ....'
try if defined('CONSTANT_CONFIG') return; instead
Post Reply