include path 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
kishanprasad
Forum Newbie
Posts: 16
Joined: Mon Feb 25, 2008 5:20 pm

include path problem

Post by kishanprasad »

i have a module module1 in my app app1


instead of giving the following syntax in all my module1 files like this
include(dirname(__FILE__)."/header.php")

can i have some thing like set_includepath(dirname(__FILE__)) in my module index page please help me
SBro
Forum Commoner
Posts: 98
Joined: Tue Sep 30, 2003 10:06 pm

Re: include path problem

Post by SBro »

Look into the ini_set() function, specifically:

Code: Select all

 
ini_set('include_path', ini_get('include_path').':/path/to/includes:');
 
What the above is doing is adding your own includes path to the existing include path specified.
kishanprasad
Forum Newbie
Posts: 16
Joined: Mon Feb 25, 2008 5:20 pm

Re: include path problem

Post by kishanprasad »

yes ima using

ini_set("include_path",get_include_path().PATH_SEPARATOR.dirname(__FILE__));

but still its not taking the relative
Post Reply