I have a question about the inclusion of an header file using PHP.
The code above is the header that I include in all my HTML/PHP view files. I want to save it inside a file called as a naming convention header.php.
My doubt is about the resources loading.
How I can load the needed stylesheets and js files if the header is included from another folder that isn't the same that hold the main css and js folders?
I want to avoid the duplication of the basic resources, and avoid having console errors due to the position of the resources files.
<!DOCTYPE html>
<html lang="it">
<head>
<!-- basic meta tag -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="author" content="" />
<!-- add facebook og tag here -->
<meta property="og:url" content="" />
<meta property="og:type" content="article" />
<meta property="og:title" content="" />
<meta property="og:description" content="" />
<meta property="og:image" content="" />
<!-- <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' https://masserianobile.it; font-src 'self' https://fonts.gstatic.com/; img-src 'self'; style-src 'self' https://fonts.googleapis.com/;"> -->
<link rel="stylesheet" href="css/bootstrap.min.css" type="text/css">
<link rel="stylesheet" href="css/fontawesome-all.min.css" type="text/css">
<link rel="stylesheet" href="css/app.min.css" type="text/css">
<script src="js/jquery.min.js" type="text/javascript"></script>
<script src="js/bootstrap.min.js" type="text/javascript"></script>
<script src=""></script>
</head>
<head>as it should be in the page, that's where you include it that matters, not where you store it.includefunction works, I was talking about the page resources, if I include the header file inside a page that is in a different folder than the site root, it will not load the css and js files due to the different position of that folders.../prefix for resources ?