Forum Moderators: coopster
$inc = $_SERVER["DOCUMENT_ROOT"]."/inc";
include ($inc."/setup.php");
$inc = $_SERVER["DOCUMENT_ROOT"]."/inc";
include ($inc.:"/setup.php");
$meta_keywords = 'keyword1 keyword2 keyword3';//in public_html/inc
$meta_keywords = 'keyword4 keyword5 keyword6';
PHP has an include_path [php.net], which specifies a list of directories where the include() function looks for files. The format is like the system's PATH environment variable: a list of directories separated with a colon in Unix or semicolon in Windows.
The include() function, includes and evaluates the specified file. Files for including are first looked in
include_pathrelative to the current working directory and then in include_path relative to the directory of current script.
If you are attempting to set the include_path in the include function, you are going to get errors.
In every page, include the setup file from the root folder, and the folder-specific setup file for page-specific options.
Something like ..
//a_page.php
include_once $_SERVER['DOCUMENT_ROOT']."/setup.php";
include_once "./setup.php";
That's how I've got everything, and it works quite well. The root folder has common functions/variables/configuration stuff, and the folders have their own files.. i.e. the 'forums' folder would have 'forums'-specific functions and classes included in every file in it.
Just a suggestion!
Alex ...