$DOCUMENT_ROOT problem

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

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

$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:

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

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

try $_SERVER['DOCUMENT_ROOT']

:)

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

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...

:)


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 2 guests

cron