I have installed Xampp, and I'm accessing a test page with this url: http://localhost/php8/test.php
test.php has the following code in it which works fine in production.
<?php include ($_SERVER["DOCUMENT_ROOT"] . "/includes/nav-blue.php"); ?>
However, when I call this url http://localhost/php8/test.php, I have the following error:
Warning: include(C:/xampp/htdocs/includes/nav-blue.php): Failed to open stream: No such file or directory in C:\xampp\htdocs\php8\test.php on line 1
Warning: include(): Failed opening 'C:/xampp/htdocs/includes/nav-blue.php' for inclusion (include_path='C:\xampp\php\PEAR') in C:\xampp\htdocs\php8\test.php on line 1
So my question is how can I call include files in my php page on Xampp? Somehow the domain name needs to be implemented somwhere to get the full path e.g. mydomain.com/includes/nav-blue.php