Includes not working

Hi. I can’t figure out why I’m getting a bunch of notices about using undefined constants when i try to load my login page.
My login page includes a definitions file - this definitions php file declarees all my constants… and i do the include right at the top of the login.

As a test, I’ve included an echo statement at the end of my include to see if it prints. It does, but only after a few “notices” about undefined constants.
can someone point me in the right direction?

I believe this error is usually caused by a lack of quotes around the URL. This: include(file.php), instead of this: include(‘file.php’). Without the quotes, php thinks your referring to a constant instead of a string.

Also commonly caused by the same around array indexes - $array[key] vs $array[‘key’]

Can you post one of the lines where your getting the undefined constants error?

Ok. Here’s one of the error messages:
( ! ) Notice: Use of undefined constant LOG_ERRORS - assumed ‘LOG_ERRORS’ in C:\wamp\www\pr\ssystem\exception\Errors.php on line 90

Line 90 looks like:
if (LOG_ERRORS)
{
$error_log = ‘Date :’.date(‘Y-m-d H:i:s’);

And BTW. The include does have quotes around it.
In my login page, the includes look like this:

include_once (BASE_PATH.‘includes/definitions.php’);

Is LOG_ERRORS actually defined somewhere?

Otherwise you could do something like this:


if(defined('LOG_ERRORS') && LOG_ERRORS) {

Yes, it is defined in the definitions file that is being included. The line of code looks like:

define(‘LOG_ERRORS’, true);

This site is actually up and runing in production, so i know it works. i’m just trying to set up a local development copy to do some work.