Return to Snippet

Revision: 7247
at July 15, 2008 17:50 by trey


Initial Code
<?php include($_SERVER['DOCUMENT_ROOT'] . "/includes/whatever.php"); ?>

Initial URL

                                

Initial Description
If you're using includes that sit in different relative locations to the files your including *into*, you normally end up with stuff like `include("../../header.php")` in one place and `include("../../../header.php")` in another.  This is a bit easier, but be sure to include a leading `/`, because depending on your sever configuration, it may or may not add one for you.  It's better to have 2 `/`s than none.

Initial Title
PHP Include Path

Initial Tags

                                

Initial Language
PHP