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

include file

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

include file

Postby 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: 29
Joined: Fri Jun 27, 2003 10:05 pm

Postby toweter » Fri Sep 12, 2003 3:27 am

you can inlude the file like that:
New php-forum User
New php-forum User
Posts: 26
Joined: Sat Aug 30, 2003 9:04 am

Postby sigix » Fri Sep 12, 2003 3:40 am

or you can user the DOCUMENT_ROOT


and then add the appropriate path ..... :arrow:
php-forum Active User
php-forum Active User
Posts: 364
Joined: Mon Jul 14, 2003 9:39 pm
Location: /Earth/Xion


Postby 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
User avatar
php-forum Super User
php-forum Super User
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India

Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 1 guest

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