include($_SERVER["DOCUMENT_ROOT"]. "../headerMenu.php");
say server doc_root is
/www/stuff/htdocs
and that index.php is in /htdocs/ .... which the doc_root of your site
now this: ../
means the parent directory to index.php (parent directory to doc_root)
which is the /stuff/ directory
could be 2 reasons it is not working:
1. you are not allowed to get any files outside of doc_root
2. there is no file headerMenu.php in /stuff/ directory
if you use this: ./
include( " ./headerMenu.php" );
this means same directory as index.php
and if you put headerMenu.php in same directory as index.php
then it will work
in this second case
./ can be removed, because this would work, just the same
include( "headerMenu.php" );
🙂