In my website, I'd like to use the PHP include line within the index.php page to add in important sections like the header and footer.
Now, the folder structure is as follow:
/index.php
/css/style.css
/includes/header.php
/includes/footer.php
Keep in mind I am working in a localhost environment.
Now my question to you is how do I properly reference my CSS file in the index.php and header.php? Should I use a config.php file? I'd like to avoid using absolute paths if that's possible.
Currently, my CSS file is read and displays properly, however, when I make changes, the CSS does not display the changes made and keeps the original unchanged file.
index.php
<head>
<link rel="stylesheet" href="css/style.css" type="text/css">
</head>
<body>
<?php include 'includes/header.php';?>
<div class="container">
<div class="inner-container">
<?php include 'includes/javascript.php';?>
</div>
header.php
<link rel="stylesheet" href="css/style.css" type="text/css">
</head>
<body>
<header>
<div id="logo">
<div class="logo-container">
<img src="img/final_logo_400px.png" alt="">
</div>
</div>
<nav>
<ul>
loadcss files inside your web pages , you will need to use html's<link />tag, not php's include function;