zenriot
03-10-2005, 07:13 PM
Hi, I am trying to have the menu of my website included on every page using include_once().
I normally program in ASP, and the PHP syntax for includes is a bit different. I want to be able to have the file included on every page, regardless of how deep it is in the file structure.
I also want to avoid having to include the entire path (ie. c:\entire\path\to\include\file.php) if possible, because this will change when moving from development server to production server.
In other words, is there a way to set the include path relative to root folder of the website, rather than relative to the file that is calling it, or right from the root of the whole file tree?
If I can't do that, and have to make some sort of case select (ie. check the hostname and set the path accordingly), is there a way to set this in only 1 place without running into the same problem of having to set the paths for THAT include?
I am aware that the include_path can be set in the php.ini file, however since the production server isn't mine and hosts many sites, I don't think that is an option.
I normally program in ASP, and the PHP syntax for includes is a bit different. I want to be able to have the file included on every page, regardless of how deep it is in the file structure.
I also want to avoid having to include the entire path (ie. c:\entire\path\to\include\file.php) if possible, because this will change when moving from development server to production server.
In other words, is there a way to set the include path relative to root folder of the website, rather than relative to the file that is calling it, or right from the root of the whole file tree?
If I can't do that, and have to make some sort of case select (ie. check the hostname and set the path accordingly), is there a way to set this in only 1 place without running into the same problem of having to set the paths for THAT include?
I am aware that the include_path can be set in the php.ini file, however since the production server isn't mine and hosts many sites, I don't think that is an option.