Re: including a file in a higher-level directory

  • From: Jared Wright <wright.jaredm@xxxxxxxxx>
  • To: programmingblind@xxxxxxxxxxxxx
  • Date: Sun, 10 Jul 2011 08:54:03 -0400

Your syntax is correct. Have you tried providing an absolute path, just to ensure that works? Then if it does you can narrow down why the relative path isn't.

On 7/9/2011 10:03 PM, Alex Hall wrote:
Hi all,
A quick php question. In a case where you want to use include() or
include_once() to include a file in a higher-level directory, how do
you do it? For instance, if the main site directory holds a file
called globals.php, and a file in the scripts folder (which itself is
inside the main directory) wants to include globals.php, what is the
syntax? I thought it would be:
include("../globals.php");
to go up a level (..) and then select globals.php from that higher
level. This, however, is not working. This is on the latest version of
WAMP. Thanks, and I hope I made this clear enough.


__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind

Other related posts: