Re: Include path
| From: | Matt M. | Date: | Fri, 23 Jul 2004 19:50:49 +0000 |
| Subject: | Re: Include path | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-191682@lists.php.net to get a copy of this message | ||
> Good solution, but the problem is once the program is
> completed it goes out of my hands and most prolly the
> client wont know the exact paths, the templates folder
> would *always* be one below...but the path before the
> /templates will change.
if you dont know what directory it will be in, how can you include it?
> Anyway, heres what I have come up with, comments are
> welcome:
>
> $pieces = explode("/", $_SERVER["PATH_TRANSLATED"]);
> $a=count($pieces);
> $f="";
> for($i=1; $i < $a-2; $i++)
> {$f=$f.$pieces[$i]."/";}
> $include_path= "/".$f;
Have you tried
$_SERVER['DOCUMENT_ROOT'].'/';