I am trying to call my header.php from project_1.php. That means that I have to go back to my root. I tried with the following, but there is no CSS is called:
<?php include dirname(dirname(__DIR__)).'/resources/includes/header.php'; ?>
The page is in:
root -> projects -> project_1.php
The header is in:
root -> resources -> includes -> header.php
When I call my header from a page there is in:
root -> index.php
the header is working fine. Does anybody knows how I can solve that?
Update after answers: Thank you for all the answers. I have tried the following, but with no result.
The path to the page is:
The header is in:
<?php include 'resources/includes/header.php'; ?>
<?php include '../../resources/includes/header.php'; ?>
<?php include dirname(dirname(__DIR__)).'resources/includes/header.php'; ?>
<?php include dirname(dirname(__DIR__)).'../resources/includes/header.php'; ?>
<?php include dirname(dirname(__DIR__)).'../../resources/includes/header.php'; ?>
<?php include( $_SERVER['DOCUMENT_ROOT'] . '/resources/includes/header.php' ); ?>
../works in includes.$_SERVER['DOCUMENT_ROOT']which is a string set to the web root of the current website. Do you get an error when you try to access it?$_SERVER['DOCUMENT_ROOT']only takes you to the webroot. So you need to use$_SERVER['DOCUMENT_ROOT'] . '/vouzalis/resources/includes/header.php'