I am using XAMPP and learning from online tutorials, i have only vedio not the source code
this is my directory structor
source file-classes(folder):core.php
source file-emails(folder)
source file-inc(folder):autoload.php,config.php, index.php
source file-pages(folder): index.php
source file-template(folder):_header.php;
the code for config.php
<?php
if(!isset($_SESSION)){
session_start();
}
defined"SITE_URL")
|| define("SITE_URL", "http://".$_SERVER['SERVER_NAME']);
defined("DS")|| define("DS", DIRECTORY_SEPARATOR);
defined("ROOT_PATH")|| define("ROOT_PATH", realpath(dirname(__FILE__).DS."..".DS));
defined("CLASSES_DIR")|| define("CLASSES_DIR", "classes");
defined("PAGES_DIR")|| define("PAGES_DIR", "pages");
defined("MOD_DIR")|| define("MOD_DIR", "mod");
defined("INC_DIR")|| define("INC_DIR", "inc");
defined("TEMPLATE_DIR")|| define("TEMPLATE_DIR", "template");
defined("EMAILS_PATH")|| define("EMAILS_PATH", ROOT_PATH.DS."emails");
defined("CATALOGUE_PATH")|| define("CATALOGUE_PATH", ROOT_PATH.DS."catalogue");
set_include_path(implode(PATH_SEPARATOR, array(
realpath(ROOT_PATH.DS.CLASSES_DIR),
realpath(ROOT_PATH.DS.PAGES_DIR),
realpath(ROOT_PATH.DS.MOD_DIR),
realpath(ROOT_PATH.DS.INC_DIR),
realpath(ROOT_PATH.DS.TEMPLATE_DIR),
get_include_path()
)));
?>
and the code for autoload.php is
<?php
require_once ('config.php');
function __autoload ($class_name){
$class = explode ("_",$class_name);
$path=implode ("/",$class).".php";
require_once ($path);
}
?>
code for the index.php in the inc folder is
<?php
require_once('autoload.php');
$core = new Core();
$core->run();
?>
code for the pages(folder) index.php is
<?php
require_once '_header.php';
?>
when i am running this last index file it show the error,
and the error is
Warning: require_once(_header.php): failed to open stream: No such file or directory in C:\xampp\htdocs\sebastine\pages\index.php on line 5
Fatal error: require_once(): Failed opening required '_header.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\sebastine\pages\index.php on line 5
please some body help me what i am doing wrong my guess is that i am doing some thing wrong in the config files but i can not find it
Thanks