Finding your Absolute Path

What is an Absolute Path? It is also called a full path. It contains the root directory and other subdirectories.

What is the point of finding your absolute path? If you’re using PHP Includes and you want it to include in a page in a separate directory, then you’ll need to find your absolute path. You can also find the directory you’re currently in or wishing to get to.

Your absolute path should be something like this:

/home/user/public_html/index.php

Copy and paste this code onto a blank page:

<?php echo $_SERVER['DOCUMENT_ROOT']; ?>
Save it as absolutepath.php. Then access the page via your default browser. It should show your absolute path on the screen.