Jump to content

Simple and Stupid


steveangelis

Recommended Posts

I know this is something stupid but I cannot see what is wrong.  I am trying a simple require for a config file and it cannot find the file even though I KNOW it is there.

 

The file is located here:

root/forums/config.php

 

The file calling it up is here:

root/home/index.php?p=members

 

I should note I am doing a template based website and the members file is located at this but it should not affect it at all:

root/home/modules/members.php

 

Here is my code:

require('../forums/config.php');

 

This should work but no matter what I do it does not and I know the path is correct.  Ideas?

Link to comment
https://forums.phpfreaks.com/topic/136955-simple-and-stupid/
Share on other sites

So you have:

require('../forums/config.php'); 

 

In members.php which is located in root/home/modules

 

in that case you're path should be ../../forums/config.php

 

../ goes one level higher up the directory tree. The first ../ goes out of the modules/ folder, the second ../ goes out of the home/ folder. However my suggestion should work though.

Link to comment
https://forums.phpfreaks.com/topic/136955-simple-and-stupid/#findComment-715286
Share on other sites

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.