View Full Version : PHP how to go back 1 dir to get inside another dir?

03-13-2009, 11:31 PM
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 inf helps

03-14-2009, 01:28 AM
A single period represents "current directory"; two periods represents "parent directory". Try "../includes/login.inc.php".

03-14-2009, 01:51 AM
Tryed that.

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
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:)

03-14-2009, 02:23 AM
scrren shot of dir structure:cool: