Newbie question on including files

How do I know if a file is being included properly?
I’m getting error messages that some constants haven’t been defined when i load my login page, but i know these variables exist.

error message:
Notice: Use of undefined constant LOG_ERRORS - assumed ‘LOG_ERRORS’ in C:\wamp\www\ est\Errors.class.php on line 227
line 227 looks like:

if (LOG_ERRORS)
{

// do something

}

My login page has a line of code that looks like this:
include_once (ROOT_PATH.‘include/define.php’);

inside define.php i have the following line of code:
define(‘LOG_ERRORS’, true);

I’m just new to PHP / APACHE… so I apologize for my basic questions!

You can always put an echo statement in the included file to make sure it’s loading. Also, make sure you called the include_once before you use it in your script.

Hi there. I do have an echo statement, that is appearing after all the error messages display…and it does appear that the include is being done before the variables are being used. The login page includes the definitions file, and then once the login is successful, the user is redirected to a main index page where everything else is supposed to happen. ?? any other suggestions would be appreciated.
thanks.

the other question is that these messages about my varialbes are showing up as “notices”. What’s the difference in PHP between a notice and a fatal error? Is a ‘notice’ a real error message

Try using the defined function:


if (defined('LOG_ERRORS'))
{

// do something

}

Here is info on the difference between each error message

That’s the extent of my knowledge.