PHP Define Full Path to a File

by in , 0

<?php
  echo dirname(__FILE__);
?>
Save the file as fullpath.php Upload to the folder you'd like to know the full path to Go to http://www.yoursite/lots/of/folders/fullpath.php

You'd might be surprised what shows up. Sometimes you need more than just /lots/of/folders/ as your full path to a file (e.g. .htpasswd). This script will allow you to see that.

Leave a Reply