supergrame Posted March 13, 2009 Share Posted March 13, 2009 include './includes/login.inc.php'; this works in the same scenario just a different folder yet this one doesn't work include './classes/membership.cls.php'; yes spelling is correct i have checked so many times I dont no what is going on please help i have also tryed require and require_once do you think it could be because of the name of the file or the directories or the content in the files?!? i was searching google and one guy said it could be the folder permissions. i have no idea about messing with that or were to start but i am running xamp, hope that extra info helps Quote Link to comment https://forums.phpfreaks.com/topic/149312-directoy-structure-issue-i-think/ Share on other sites More sharing options...
supergrame Posted March 13, 2009 Author Share Posted March 13, 2009 here is another eg. i have a folder (members)-index.php i have a folder (constants)-constants.php i have a folder (classes)-mysql.cls.php in the index i have these lines <?php session_start(); require_once 'constants/constants.php'; new membership(); ?> and the same lines are at the top of constants.php yes the mysql.cls.php can require constants but index.php in the members folder can not remember im new to this maybe i have missed something I had no idea i missed but I have tryed alot difrent ways trial and ERROR. any help at all would help me find other ways to try, Thank you Quote Link to comment https://forums.phpfreaks.com/topic/149312-directoy-structure-issue-i-think/#findComment-784205 Share on other sites More sharing options...
lonewolf217 Posted March 13, 2009 Share Posted March 13, 2009 what is the folder structure of the include files as opposed to the folders containing the pages you are including on ? Quote Link to comment https://forums.phpfreaks.com/topic/149312-directoy-structure-issue-i-think/#findComment-784217 Share on other sites More sharing options...
supergrame Posted March 14, 2009 Author Share Posted March 14, 2009 screen shot of structure TBP is main dir [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/149312-directoy-structure-issue-i-think/#findComment-784232 Share on other sites More sharing options...
plutomed Posted March 14, 2009 Share Posted March 14, 2009 Do you get an error message? Quote Link to comment https://forums.phpfreaks.com/topic/149312-directoy-structure-issue-i-think/#findComment-784239 Share on other sites More sharing options...
samshel Posted March 14, 2009 Share Posted March 14, 2009 try require_once '../constants/constants.php'; Quote Link to comment https://forums.phpfreaks.com/topic/149312-directoy-structure-issue-i-think/#findComment-784240 Share on other sites More sharing options...
supergrame Posted March 14, 2009 Author Share Posted March 14, 2009 Yes that worked fine but what i really want to require is this require_once '../includes/login.inc.php'; and that does not work. is that because of the includes DIR or maybe the .inc part. confusing stuff Quote Link to comment https://forums.phpfreaks.com/topic/149312-directoy-structure-issue-i-think/#findComment-784249 Share on other sites More sharing options...
supergrame Posted March 14, 2009 Author Share Posted March 14, 2009 or should i have a separate includes DIR in my members DIR. but even so that request should still work. sorry if i dont make to much sence im working on no sleep :-\ Quote Link to comment https://forums.phpfreaks.com/topic/149312-directoy-structure-issue-i-think/#findComment-784255 Share on other sites More sharing options...
lonewolf217 Posted March 14, 2009 Share Posted March 14, 2009 what if you just remove the dots from before /includes. since Includes is a root level folder it should pick it up properly that way. having a single "." before it means you are starting in the CURRENT directory and looking for that folder which i dont think you want Quote Link to comment https://forums.phpfreaks.com/topic/149312-directoy-structure-issue-i-think/#findComment-784263 Share on other sites More sharing options...
samshel Posted March 14, 2009 Share Posted March 14, 2009 i think it has nothing to do with filename.. it checks the relative path when it tries to include the file. example: index.php members/members.php includes/config.inc.php in index.php you can.. include("members/members.php"); include("includes/config.inc.php"); as from the DIR where index.php is, it can access the two folders and files inside them.. to include config.inc.php from members.php include("../includes/config.inc.php"); as members.php is inside members folder, it will have to look up the includes folder one level up (and hence ../) from where it is located. Quote Link to comment https://forums.phpfreaks.com/topic/149312-directoy-structure-issue-i-think/#findComment-784267 Share on other sites More sharing options...
supergrame Posted March 14, 2009 Author Share Posted March 14, 2009 hey thanks for all your guys advise. i will test a few things out and get back to you tomorw. even if i found the problem ill post it. im off to nightly night land. Quote Link to comment https://forums.phpfreaks.com/topic/149312-directoy-structure-issue-i-think/#findComment-784272 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.