Jump to content

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

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.