Whenever I use a "/" at the beginning of a path (to reference the root directory) when including a file using the php include function it comes up with an error saying that it could not be found. Perhaps I am not using it correctly. I am using:
Code:
<?php
include('/navbar.php');
?>
the file is in my public_html folder and can be accessed directly from there or by using "../navbar.php" from the a sub folder. I am including this from many locations in my site and would prefer not to use ../../../ everytime. I guess my questions are:
1. Am I using the "/" path correctly?
2. If so, what am I doing wrong when pathing to my file?