First a little background.
- i love that i can add PHP pages directly by simply adding a php "page" by "adding content"... very powerful feature.
- i don't like OR don't get the way drupal deals with multisite absolute folder references
by this i mean - i developed site (site1) on my devel station which showed up as http://site1/ after mapping that to localhost in my hosts file
but then when i copied everything to my server - site1 was broken
eventually i figured out that i had to rename "site1" folder to ""site1.mydomain.com" to get it working.
maybe there is a reason for this - but i can't think of a decent one... and this makes things a real pain in the ass.
so that all being said, and getting back to my php pages - rather than add php code directly into page content i simply add a single line to include a file (that way i can edit file in a real editor/debugger).
so my page content is simply:
<?php
include ("sites/site1/pages/page17.php");
?>
so.. is my dilema obvious yet???
now when i move my DB to server this can't work - since "site1" folder sadly had to be renamed to "site1.mydomain.com"
so i figured.. kinda naively that i could use a built in PHP server VAR to get full path (and thereby removing server remap issue), like:
<?php
$base_dir = substr($_SERVER['PATH_TRANSLATED'], 0, strrpos($_SERVER['PATH_TRANSLATED'], "/")) . "