Mon 27 Feb 2006
For this script I decided early that I wanted to keep the code clean as possible. In the past project complexity has overwhelmed my ability to write maintainable code, so I decided to break this script up into several seperate files.
File:
- config.php
- footer.php
- header.php
- html.php
- index.php
As you can probably tell, each file has a specific purpose.
The main script, which calls the other functions is of course index.php. This is the portion where we load all or required helper functions, and determine the status of any queries that were made to the site.
Config.php is where i’m keeping all those important variables which are global to my script, such as database login information. This is also where I put my code that determines what stylesheet should be used.
In header.php we start the initial page generation. This is where I will keep the top portion of any webpages that are created, including header information, and the beginning of my xhtml markup.
If index.php is the head of this monster, then surely html.php is the arms, and torso. It’s where most of the page generation takes place. The functions in here are called by index.php according to what query was provided.
Finally footer.php is where i’m keeping the bottom portion of any pages that are created.
I will go into more depth on each part of the script in future postings. Wanted to show the basic idea of what i’m trying to do with this project.