Just use absolute paths. If your webserver is looking at the root directory, /index.phtml and index.phtml are the same file
Matt ----- Original Message ----- From: WMB <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, December 30, 2002 12:03 PM Subject: [PHP] Continued story on : PHP includes without access to the default directory//Tom Rogers// > Hi, original messagethread on dec 6, 2002, but still have following question > on same/continued subject by Tom Rogers:(see below) > > Like you say it works (with the correction) "." for which my thanks, but: > > if one my includes is a menu.php where there are links inside, how should > these work from rootdirectory and from subdirectories. > for rootfilelinks they now just say f.i. index.php, but when called from > inside a subdirectories they are supposed to say /index.php. > > Any solutions for this one?? > thanks > Martin > =====================Original Posting=============================== > Saturday, December 7, 2002, 7:15:38 AM, you wrote: > > >> ini_set > G> ("include_path","/path/to/local/includes:"ini_get("include_path")); > >> > >> Then no matter what directory you are in you can just > include("filename"); > >> > >> -- > >> regards, > >> Tom > >> > > G> Thank you. This should work, but I have one question about the format of > G> that. this way I can make sure I do things right (getting a parse error > G> right now) > > G> what did you mean by "include_path"? > G> /path/to/local/includes is just the path to the default includes folder? > G> and is include_path just the path to the includes folder that I use. And > G> with this, do I use the URL, or the file path (what I get whenever I get > G> errors) > > G> and thank you again > Looks like I forgot a '.' in there :) > "/path/to/local/includes:" is the path to your new includes, we do that > first so > that is the first place it will look . The ':' is used to add in another > path > which we use ini_get() to retrieve the system wide include file from > php.ini. > You may drop this and the ':' if you don't need it. > > so if you are setup like this for example > > /home/username/public_html/...........web directory > /home/username/includes/..............your include directory > > the line would be > > ini_set("include_path","/home/username/includes:".ini_get("include_path")); > > -- > regards, > Tom > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php