Include PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Aravinthan
Forum Commoner
Posts: 84
Joined: Mon Jan 28, 2008 6:34 pm

Include PHP

Post by Aravinthan »

Hey,
Ok i got a problem, that is pretty much simple but it is killing me.
I have 2 folders:
36Drew
and Division1
There is a file in division1(nav.php) that I want to include in index.php in 36Drew folder. How can I link it? I tried giving the direct adress(url) didnt work. Then I gave: www/Division1/nav.php didnt work. So I am bit lost.

Thanks for your help,
Ara
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: Include PHP

Post by papa »

Have you tried include() or include_once() ?
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: Include PHP

Post by aceconcepts »

when using include etc... use "../" to navigate up one level. If desired file is two levels up then use "../../"
Aravinthan
Forum Commoner
Posts: 84
Joined: Mon Jan 28, 2008 6:34 pm

Re: Include PHP

Post by Aravinthan »

I tried it aceconcepts, but it doesnt work.
User avatar
Syntac
Forum Contributor
Posts: 327
Joined: Sun Sep 14, 2008 7:59 pm

Re: Include PHP

Post by Syntac »

Code: Select all

include "../Division1/nav.php";
Post Reply