Finding Your Absolute Path

For a lot of PHP scripts, and even if you're just using PHP headers and footers, a lot of the time you'll end up having to use your absolute path. Usually, it looks a little like this:

/home/your username/the folder all your site files are in/file.php


But for some people, this isn't the case. Finding out for sure what you're absolute path is really easy! All you need to do is make a file and look at it!

Start by making a PHP file and name it anything. For the sake of formality, let's call it path.php.
On path.php, just put this simple code:

<?php
$p = getcwd();
echo $p;
?>


Now upload this to your site's main directory, open it up in your browser, and see what it says!