-1

Inside my admin folder i have index.php and i can't make it load, i put require_once dirname(__DIR__).'/includes/header.php'; inside, to load header.php that is inside includes folder, and the same for footer.php. But i get this error:

Warning: require_once(functions/sanitize.php): failed to open stream: No such file or directory in C:\xampp\htdocs\Monk Studio 24.08.2016\core\init.php on line 25

Fatal error: require_once(): Failed opening required 'functions/sanitize.php' (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\Monk Studio 24.08.2016\core\init.php on line 25

Inside header.php i have require_once dirname(__DIR__).'/core/init.php'; and it works fine. The problem is i think because /admin/index.php is including /includes/header.php and he is including /core/init.php that has includes for /functions/sanitize.php and others...

I'm confused...

Ikari
  • 3,176
  • 3
  • 29
  • 34
Monk
  • 105
  • 9
  • Possible duplicate of [Failed to open stream : No such file or directory](http://stackoverflow.com/questions/36577020/failed-to-open-stream-no-such-file-or-directory) – Vic Seedoubleyew Aug 29 '16 at 17:56

1 Answers1

1

Instead of the require_once try for the include option

Replace:

require_once dirname(__DIR__).'/includes/header.php';

With

include('includes/header.php');

Hope so this shall make a trick for you

Naresh Kumar P
  • 4,127
  • 2
  • 16
  • 33