Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/149312-directoy-structure-issue-i-think/
Share on other sites

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

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

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.

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.