Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

$DOCUMENT_ROOT problem

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

$DOCUMENT_ROOT problem

Postby tbone2k » Thu Apr 03, 2003 9:19 am

For some reason PHP won't let me use the variable $DOCUMENT_ROOT.
It doesn't give an error, it just doesn't print anything when i call echo "$DOCUMENT_ROOT";

is it the case that doing something like:
$entries=opendir("$DOCUMENT_ROOT/admin/users");
will open the correct directory its just that when you try and print out $DOCUMENT_ROOT it doesn't let you.

Can anyone help,

Cheers :wink:
tbone2k
New php-forum User
New php-forum User
 
Posts: 3
Joined: Thu Apr 03, 2003 9:10 am
Location: UK

Postby pootergeist » Thu Apr 03, 2003 9:51 am

try $_SERVER['DOCUMENT_ROOT']

:)
pootergeist
New php-forum User
New php-forum User
 
Posts: 191
Joined: Wed Jan 29, 2003 7:11 am
Location: UK

Postby tbone2k » Thu Apr 03, 2003 11:29 am

That works. Thanks.

Howerver, i downloaded a script which uses $DOCUMENT_ROOT throughout and i'm not sure whether it is this that is making the script not work...

:)
tbone2k
New php-forum User
New php-forum User
 
Posts: 3
Joined: Thu Apr 03, 2003 9:10 am
Location: UK


Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 4 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.