Hi everyone,
I have a controller file that consists entirely of php. It just queries the database and then it includes another template file.
This template file has the following at the top:
<?php
if ($_SERVER['HTTP_HOST'] != "new_site.com") {
define ('__ROOT__', $_SERVER['DOCUMENT_ROOT'] . '/new_site');
} else {
define ('__ROOT__', $_SERVER['DOCUMENT_ROOT']);
}
include_once(__ROOT__ . "/includes/helpers.inc.php");
include_once(__ROOT__ . "/includes/config.inc.php");
?>
When I test the template page in the browser, I looked in the source code and saw the following error:
Notice: Constant ROOT already defined in /Applications/MAMP/htdocs/new_site/consumer/catalogue/catalogue.php on line 3
Line 3 is the following from the above code:
define ('ROOT', $_SERVER['DOCUMENT_ROOT'] . '/new_site');
Does anyone know why I'm getting this error?
Appreciate any help.