NYCPHP Meetup

NYPHP.org

[nycphp-talk] Include File Access

Jeff jsiegel1 at optonline.net
Mon Sep 8 14:17:45 EDT 2003


You may want to examine this thread
(http://lists.nyphp.org/pipermail/talk/2003-September/005065.html )
since we were just discussing this very question.
 
Jeff

-----Original Message-----
From: talk-bounces at lists.nyphp.org [mailto:talk-bounces at lists.nyphp.org]
On Behalf Of Rudy Gamberini
Sent: Monday, September 08, 2003 1:02 PM
To: NYPHP Talk
Subject: [nycphp-talk] Include File Access


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
 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20030908/983e422f/attachment.html>


More information about the talk mailing list