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 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 :) 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! 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
Archived
This topic is now archived and is closed to further replies.