NYCPHP Meetup

NYPHP.org

[nycphp-talk] FUNDAMENTALS #1: Site Structure

Jeff jsiegel1 at optonline.net
Thu Sep 4 06:59:14 EDT 2003


FUNDAMENTALS #1: Site Structure:  Where to Locate Includes?

Index.php is always located in a website's document root, /var/www/html/
on 
a Linux box.
Where should includes be located?

Here are some possibilities:
* in the same directory, /var/www/html/
* in a subdirectory of document root, /var/www/html/includes/
* in a parallel directory to document root, /var/www/includes

What are the advantages and disadvantages of each possibility?
IN THE SAME DIRECTORY
* simple
* but confusing and cluttered if there are more than just a few
IN A SUBDIRECTORY
* provides a logical place for them
* but exposes them to browsers
IN A PARALLEL DIRECTORY
* provides a logical place for them
* doesn't expose them to browsers
* but perhaps write privileges are not available (or needed?)

What does exposure matter?
If the include file contains html, it will be visible in the calling
file's 
source code.
If it contains php code (like a database connection), it will never be 
visible anyway.

Are there important principles here, or is location just a matter of 
preference?

=======================================================================
Don't know what this posting is all about?
See: http://lists.nyphp.org/pipermail/talk/2003-September/005049.html
=======================================================================

Jeff




More information about the talk mailing list