Skip to content

Instantly share code, notes, and snippets.

@RKAN
Created July 19, 2013 16:09
Show Gist options
  • Save RKAN/6040364 to your computer and use it in GitHub Desktop.
Save RKAN/6040364 to your computer and use it in GitHub Desktop.
//gets the path to your root directory of your site
<?php
$path = $_SERVER['DOCUMENT_ROOT']; //gets the path to your root directory of your site
//now all links instead of being:
// (images/index.php) and have it be different across all pages, use this:
include_once ($path . '/layout/footer.php'); //and it is now universal across all pages
//found at: http://css-tricks.com/php-include-from-root/
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment