include file

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 29
Joined: Fri Jun 27, 2003 10:05 pm

include file

Post by DigitalRice » Thu Sep 11, 2003 7:01 pm

hi expert
i have trouble of include file that if the directory is too deep, it cannot include it, how come?

here is my problem.

from z.php i want to include a file from main directory, which is from http://localhost/

but it keeps giving me error. can i fix it?


New php-forum User
New php-forum User
Posts: 26
Joined: Sat Aug 30, 2003 9:04 am

Post by toweter » Fri Sep 12, 2003 3:27 am

you can inlude the file like that:

php-forum Active User
php-forum Active User
Posts: 364
Joined: Mon Jul 14, 2003 9:39 pm
Location: /Earth/Xion

Post by sigix » Fri Sep 12, 2003 3:40 am

or you can user the DOCUMENT_ROOT


and then add the appropriate path ..... :arrow:

User avatar
php-forum Super User
php-forum Super User
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India


Post by ruturajv » Sat Sep 13, 2003 12:17 am

if you are on the same server [localhost] then you can give the relative path of the include file depending the location of the file eg. if the file is in the DocumentRoot directory of the VirtualHost then give

Code: Select all


Post Reply

Who is online

Users browsing this forum: Baidu [Spider] and 11 guests