note 90340 deleted from function.include by danbrown

From: Date: Fri, 17 Apr 2009 00:17:18 +0000
Subject: note 90340 deleted from function.include by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-153414@lists.php.net to get a copy of this message
Note Submitter: gabe m. ---- After lots of research, I've found this is the most useful way of accessing a folder of include files 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

« previous php.notes (#153414) next »