Daze Posted March 10, 2006 Share Posted March 10, 2006 Hello all,I'm quite a newbie with php and I hope this is an easy-to-solve newbie problem. This is part of my application directory structure:root/index.phproot/config.phproot/pages/main/login.phproot/lib/func.phproot/lib/funclogin.phpand I am using smarty templates. The problem is the following:when I include func.php & config.php in login.php as the following:[code]include_once('../lib/func.php');include_once('../config.php');[/code]it will warn me that the files can not be found. Am I doing something wrong here or is it something else?Thanks in advance.Cheers,Daze Quote Link to comment https://forums.phpfreaks.com/topic/4585-problem-including-file-from-other-directory/ Share on other sites More sharing options...
keeB Posted March 10, 2006 Share Posted March 10, 2006 [code]include_once('../../lib/func.php');include_once('../../config.php');[/code]you gotta realize.. each '../' is like going back one folder.. not starting from the beginning :) Quote Link to comment https://forums.phpfreaks.com/topic/4585-problem-including-file-from-other-directory/#findComment-16049 Share on other sites More sharing options...
Daze Posted March 10, 2006 Author Share Posted March 10, 2006 you are right. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/4585-problem-including-file-from-other-directory/#findComment-16061 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.