I'm using XAMMP and using this variable in my index.php pages:
($_SERVER ["DOCUMENT_ROOT"] . "/path/to/my/php/file);"
My file structure is like so located in the htdocs folder:
myprojectnet/include
myprojectnet/css
myprojectnet/js
myprojectnet/folder1/index.php, css folder and js folder, etc;
myprojectnet/folder2/index.php css folder and js folder, etc;
Inside my index.php files I've used this variable:
($_SERVER ["DOCUMENT_ROOT"] . "/include/header.php");
Inside my header.php file the structure is like so:
<HTML>
<HEAD>
<link rel="stylesheet" type="text/css" href="css/name.css">
<script src="js/jquery.js"></script>
I'm having to put my css folder and js folder inside the same directories where my index.php file resides and I shouldn't have to do this when my header.php file should be resolving the path to my css folder and js folder correctly.
$_SERVER ["DOCUMENT_ROOT"]will hardly ever have anything to do with client-side URLs.