note 90339 deleted from function.ini-set by danbrown
| From: | danbrown@php.net | Date: | Fri, 17 Apr 2009 00:15:59 +0000 |
| Subject: | note 90339 deleted from function.ini-set by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-153415@lists.php.net to get a copy of this message | ||
Note Submitter: gabe m.
----
After lots of research, including combing through the helpful comments on this page, I've found
this is the most useful way of accessing a folder of includes at the root of a website from any
page..
I simply add this line at the top of each of my .php pages:
<? ini_set("include_path", "." .PATH_SEPARATOR. "../"
.PATH_SEPARATOR. "../../" .PATH_SEPARATOR. "../../../"); ?>
This configures the include_path directive to look for include files up to 3 folders *above* the
current file
Note: Using the PATH_SEPARATOR constant instead of ";" or ":" covers both
Windows & Unix php installations. Also keep in mind that if some of your pages are any deeper
than 3 folders, you will need to add more paths..
Then any include statements (where includes are kept in a folder called "includes" at the
root) look like this:
<? include("includes/header.inc.php"); ?>
Hope this helps.
- gabe m