Jump to content

php Dynamic directories


JonnySnip3r

Recommended Posts

Hey guys does anyone know of a good dynamic directory solution? What i mean by this is when i am creating an application and i use

 

require_once 'includes/config.php';

 

and then i create a class that needs the config file so i include it into the class like so:

 

require_once '../include/config.php';

 

then i make a new folder named member then i have to require this class (created above) and it fails to find the directory.

 

What would be a good solution for this?

 

Thanks guys!!

Link to comment
https://forums.phpfreaks.com/topic/227551-php-dynamic-directories/
Share on other sites

Well for one your include(s) directory is spelled differently in those statements.

 

require_once 'includes/config.php';

 

require_once '../include/config.php';

 

Can you show us the directory structure of the application? Knowing the location of the files relative to each other is important.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.