Ian,
Thanks for the reply!
What I am trying to do is take data that looks like these:
$fullPath = '/home/sumsite/public_html/facilities/vDocs/1/Clown.jpg';
$fullPath = '/home/sumsite/public_html/facilities/Dog.jpg';
and parse them uniformly into
$webPath = /facilities/vDocs/1/Clown.jpg';
$webPath = /facilities/Dog.jpg';
So they can be accessed by a browser. PHP_SELF in these case won't relate
to the dir in question. Maybe I can use chdir to my advantage here...
Thanks for looking,
jg
"Ian.H" <ian@WINDOZEdigiserv.net> wrote in message
news:mtcmk01dao6kemejqnlutmr573bb83g8s0@4ax.com...[color=blue]
> On Fri, 17 Sep 2004 11:57:39 -0500, "jerrygarciuh"
> <designs@no.spam.nolaflash.com> wrote:
>[color=green]
> >Hello,
> >
> >If you have the whole server path for a file is there a canonical way to[/color][/color]
get[color=blue][color=green]
> >the path from document root for that file so that you can present the[/color][/color]
file[color=blue][color=green]
> >ina browser or for download? Check $_SERVER['document_root'] and parse[/color][/color]
the[color=blue][color=green]
> >path?
> >
> >My thought is that given OS diversity and individual server differences[/color][/color]
(eg[color=blue][color=green]
> >www vs public_html vs htdocs) that there may be no one-size-fits-all
> >solution but I thought I would throw this out there any way.
> >
> >Thanks for any advice,
> >
> >jg
> >[/color]
>
>
> If I understand your question correctly, you could use something like:
>
>
> $path = dirname($_SERVER['PHP_SELF']);
>
>
> If the URI is 'foo.com/bar/baz/page.php', $path will be '/bar/baz'.
>
>
> HTH =)
>
>
>
> Regards,
>
> Ian
>
> --
> Ian.H
> digiServ Network
> London, UK
>
http://digiserv.net/[/color]