include() problem

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
Bert
Forum Newbie
Posts: 6
Joined: Sat Dec 07, 2002 12:26 pm
Location: California, USA

include() problem

Post by Bert »

I have my navigation bar in "includes/header.php" and i include that file to all my pages so I only have to modify one file to add more to the navigation bar. But when I add

include("http://domain.com/includes/header.php");

to quests/index.php I get an error.
User avatar
qiangxd
Forum Newbie
Posts: 8
Joined: Thu Dec 05, 2002 6:00 pm

Post by qiangxd »

include("./includes/header.php");
Bert
Forum Newbie
Posts: 6
Joined: Sat Dec 07, 2002 12:26 pm
Location: California, USA

Post by Bert »

It still doesnt work.
Warning: Failed opening './includes/header.php' for inclusion (include_path='') in /host/r/o/-/p/o/r/ro-adven.port5.com/rsk/quests/index.php on line 3
---
Warning: Failed opening './includes/footer.php' for inclusion (include_path='') in /host/r/o/-/p/o/r/ro-adven.port5.com/rsk/quests/index.php on line 60
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post by hob_goblin »

include("../includes/header.php");
oldtimer
Forum Contributor
Posts: 204
Joined: Sun Nov 03, 2002 8:21 pm
Location: Washington State

Post by oldtimer »

Exactly. For things in another folder up it is just /folder/page.php
For one under it is ../page.php
Or For in another folder down and then up it is ../folder/page.php.
Post Reply