I think:
string getcwd ( void)
would do the trick. (dirname() requires that you know the path of a file and
want to extract just the directory path)
-Brad

"John W. Holmes" wrote:

> OK. My bad. That's why I see DOCUMENT_ROOT on sourceforge is /var/www/,
> while my scripts are in /home/groups/p/pr/project/htdocs/.
>
> Sorry for causing confusion in the ranks. :)
>
> So what the OP wants is dirname() ??
>
> ---John Holmes...
>
> > -----Original Message-----
> > From: Chris Shiflett [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, October 01, 2002 6:39 PM
> > To: [EMAIL PROTECTED]
> > Cc: 'Tony Crockford'; 'Php-General@Lists. Php. Net'
> > Subject: Re: [PHP] document_root
> >
> > *cringe*
> >
> > No, document root is a defined directory, not an attribute of a
> specific
> > file. It is used to map the root URL to a directory on the filesystem.
> >
> > For example, when you request http://www.google.com/, that final slash
> > in the URL is the resource you are requesting. In this case, it is the
> > root URL for that domain, and everything branches off from that
> > hierarchically.
> >
> > Document root is the filesystem directory that is equivalent to the
> root
> > URL and is used by the Web server to locate the requested resource.
> > Thus, everything within this directory is (potentially, depending on
> > permissions) accessible via a URL. For example, if the document root
> for
> > Google were /usr/local/apache/htdocs/, then the URL
> > http://www.google.com/foo/bar/blah.php would be equivalent to
> > /usr/local/apache/htdocs/foo/bar/blah.php on the filesystem.
> >
> > Hope that clarifies.
> >
> > Chris
> >
> > John W. Holmes wrote:
> >
> > >You want DOCUMENT_ROOT. If you have a file
> > >
> > >/home/groups/myproject/htdocs/file.php
> > >
> > >then, from within that file.php, DOCUMENT_ROOT is
> > >
> > >/home/groups/myproject/htdocs/
> > >
> > >I think it would be $_SERVER['DOCUMENT_ROOT'] in newer versions of
> PHP.
> > >
>
> --
> 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

Reply via email to