I'm trying to create a php file which I want to include in various other php file and I am trying to add references to my CSS files but I'm having problems due to my directory structure. Off the root folder I have 3 folders, admin, includes and styles. The CSS files are located in styles folder and any files that I will include in pages are located in the includes folder. My problem is that I can't figure out how to ensure my CSS files are found, at present if I specify the location of the css files based on the root the files won't be found from the pages in the sub folders. I've tried solutions I found online including $_SERVER['SERVER_NAME'] and $_SERVER['DOCUMENT_ROOT'] without success and I have no idea what I'm doing wrong or what else to try. I'm completely new to PHP so any help would be greatly appreciated. Below is my code. Thanks
<head>
<?php
$server = 'http://'.$_SERVER['SERVER_NAME'];
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="<?php echo $server . '/2025/styles/reset.css' ?>";
<link rel="stylesheet" href="<?php echo $server . '/2025/styles/normalize.css' ?>";
<link rel="stylesheet" href="<?php echo $server . '/2025/styles/characters.css' ?>";
</head>