Structure of a PHP-driven site

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hey everyone,

I've been managing a few websites, all built around the same
architecture, for several years now, but it's time to hand them off to
someone else and I'm trying to "clean them up" before I go.  It got me
to wondering how other people structure their sites, and if mine is

For instance, all of the pages on my site are accessible from one
navigation bar with several subcategories.  Each page starts by
declaring $page_title, $page_category etc, and then including a
standard headers file, with our logo/banner/database connection/etc,
and finally including a second navigation bar for whatever category
the page is in.  Then you put whatever content you want on the page,
and end it by including a standard footers file.

I was considering moving all of the data like $page_title,
$page_category, and the entire menu/category structure into a separate
XML file, or an array in PHP.  Then, each page would just look like
"include(headers), page content, include(footers)", and PHP would
simply lookup the page's file name in the XML table/array, and render
the appropriate navigation bars, styles, whatever.  Somehow the idea
of having the entire sitemap in one XML file or array seems really
elegant to me.

Does this sound like a good idea?  How do you usually structure your
pages?  Is it even remotely like this?  I get the sense that what I'm
doing now is a sort of a beginner's technique for building dynamic

Re: Structure of a PHP-driven site

Quoted text here. Click to load it

Take a look at:

Site Timeline