Sherida van den Bent Sherida van den Bent - 1 year ago 116
PHP Question

PHP: undefined constant while defining it

I'm getting the following error in PHP:

Notice: Use of undefined constant CONSTANT

on the exact line where I define it:

define(CONSTANT, true);

What am I doing wrong? I defined it, so why does it say "Undefined constant"?

Answer Source

You need to quote the string which becomes a constant

define('CONSTANT', true);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download