kishan Posted October 16, 2008 Share Posted October 16, 2008 HI all please help me regarding the include path iam having a app which inlcudes so many modules for ex: app/module1 ...app/module2 now in module1 i want to include a relative path for my module1 files so that if i give inlcude("header.php") it should search in my app/module1 instead of app so i will not change any of my module1 files to navigate to the right page iam using the set_includepath("http://localhost/app/module1"); but still the include("header.php") throwing a 404 error. how can i achieve this... Quote Link to comment https://forums.phpfreaks.com/topic/128701-include-path/ Share on other sites More sharing options...
MadTechie Posted October 16, 2008 Share Posted October 16, 2008 first of set_includepath uses local file access so no http:// stuff their try this include(dirname(__FILE__)."/header.php") Quote Link to comment https://forums.phpfreaks.com/topic/128701-include-path/#findComment-667010 Share on other sites More sharing options...
kishan Posted October 17, 2008 Author Share Posted October 17, 2008 hi sorry like iam including like set_includepath("c:\xamp\htdocs\app\modules") is it not effects i will try with this include(dirname(__FILE__)."/header.php") will this make as relative path in my sub modules Quote Link to comment https://forums.phpfreaks.com/topic/128701-include-path/#findComment-667772 Share on other sites More sharing options...
MadTechie Posted October 17, 2008 Share Posted October 17, 2008 okay i assume you didn't want that then lol, in any case you can just move down a dir by adding ../ ie include(dirname(__FILE__)."/../header.php") Quote Link to comment https://forums.phpfreaks.com/topic/128701-include-path/#findComment-667849 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.