NYCPHP Meetup

NYPHP.org

[nycphp-talk] FUNDAMENTALS #1: Site Structure

Seth [Ghiek] seth at ghiek.com
Thu Sep 4 07:33:00 EDT 2003


The parallel directory to document root, /var/www/includes, is my vote. No
matter what happens, the .inc files are not available to anyone other than
those who have ftp access.

Once you have decided that your .inc files are outside the public area, it
is an easy matter to consistently format your require statements that are
within your .php code.

Locating .inc files in a parallell directory to the document root reduces
one less factor (ie, noone but u can get to them) that causes headaches
later. Why think about the possibility of a prob when u can discount it
completely?

spirits,

seth j hersh

-----Original Message-----
From: talk-bounces at lists.nyphp.org
[mailto:talk-bounces at lists.nyphp.org]On Behalf Of Jeff
Sent: Thursday, September 04, 2003 6:59 AM
To: 'NYPHP Talk'
Subject: [nycphp-talk] FUNDAMENTALS #1: Site Structure


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

_______________________________________________
talk mailing list
talk at lists.nyphp.org
http://lists.nyphp.org/mailman/listinfo/talk







More information about the talk mailing list