NYCPHP Meetup

NYPHP.org

[nycphp-talk] Include File Access

Michael Southwell southwell at dneba.com
Mon Sep 8 14:27:41 EDT 2003


This is precisely what the recent Fundamentals topic was.  Within a week we 
should have a beta of "best [or at least common] practices"--no help to you 
now, I realize--except that you have just contributed yet another element 
to the complexity of the example.


At 02:02 PM 9/8/2003, you wrote:
>Give the following web site file architecture:
>
>            Root
>               |
>      -----------------------------
>      |                 |              |          |
>page1         page2      page3    inc
>
>I place my util.php file in the "inc" directory.  As it turns out I need 
>to access this file from the Root directory as well as the various page 
>directories.  While I can place the relative path to the include file 
>with   { include "./inc/util.php"  } for the Root and   { include 
>"../inc/util.php" }  for the sub-pages, this causes problems with my 
>common code.
>
>I construct my pages with common code that controls the left side of the 
>page.  This code utilizes the functions in the util.php include.  As it 
>stands now the include fails because the util.php file cannot be found.  I 
>really don't want to modify this include statement for each of my pages 
>depending on their depth relative to the directory containing the include 
>files.
>
>Granted I could flatten the site structure and get rid of this problem but 
>that would create considerable complexity when trying to work on the site.
>
>I was thinking about creating an environment PATH to the inc directory as 
>one way to keep the include code that same and still be able to access the 
>util.php file.
>
>Any suggestions??
>
>Thanks,
>Rudy
>
>_______________________________________________
>talk mailing list
>talk at lists.nyphp.org
>http://lists.nyphp.org/mailman/listinfo/talk

Michael G. Southwell =================================
DNEBA Enterprises
81 South Road
Bloomingdale, NJ 07403-1419
973/492-7873 (voice and fax)
southwell at dneba.com
http://www.dneba.com
======================================================





More information about the talk mailing list