Adding Pages - PHP
Did you ever have one of those sites that started out small, but kept growing and growing? Adding new pages to a site or removing old ones can often take more time than developing the pages themselves.
Now that the TEMPLATE.HTML file is completed (with the possible exception of changing the table border to 0), it can be used as the basis for new pages on the web site. Just do a SAVE AS to the filename of the new page, and put the page content in the "3 - Main Body" area.
Don't forget to go into PAGES.HTML and add the name of the new page to the array definition. By the way, the pages named in the array display in the menu in the exact order in which they occur in the array. By altering this order, you can alter the order in which pages appear in the menus.
You will also need the following 5 graphics files for each page:
FOO-H.gif - header graphic
FOO-B.gif - graphic panel that changes when hovering over buttons
FOO-OFF.gif - default button displayed for non-current page
FOO-ON.gif - button displayed when onMouseOver
FOO-IN.gif - button graphic displayed when page is current
(GIF files were used in this example. JPG's and PNG's work just as well. Just remember that every file of each type must be the same format.)
Adding one page or one hundred pages is now just a matter of using the template file and then generating the graphics files.
Another good use for PHP is separating the content of a page from the structure of a page, thus making site maintenance even easier and nearly eliminating formatting mistakes, but that's a subject for another article.