Or, From Static to PHP Just a little background I have had a web site of some sort since around 1995. What you see on this site is, of course, the current implementation. As with most sites, this is not how it started. Though I have worked with some of the technologies used to created dynamic web sites, I have not used them to my own web site until fairly recently. For a very long time, I had a purely static web site, static HTML pages and mostly static content, too. Between then and now, I have experimented with various approaches, still having a mostly static result. Other than just adding some simple links pages, the early changes were to add some of my photography to the site just to add some spice. This helped some, adding some visual interest if not much else. For a time, I experimented with the ArsDigita Community System(ACS). This web application framework was written in Tcl, ran on AOLserver and used the Oracle database server. This had the capability of creating dynamic web sites, though it also included an associated cost that made it prohibitive for my to use long-term for my personal web site. OpenACS offered an alternative to this. Based on ACS, it used the PostgreSQL database instead of Oracle. Also written in Tcl and running on AOLserver, this provided the capability for dynamic web sites with a lower cost of entry. While fun to experiment with for a while, I felt the need for something more, more mainstream that is. Part of the desire to use mainstream technologies was the desire to development marketable skills. So, during the ACS experimentation, I also looked at having a Java based web site. This testing and evaluation was done using the Apache web server combined with the Jakarta Tomcat Java Servlet container. This, too, was fun to work with and more popular than Tcl and AOLserver. Further experimentation used Perl and Python with the Apache web server, two other popular solutions. Eventually, I ended up with the framework I have now, which seems to be growing in popularity. What next? Developing web applications at work with Microsoft’s ASP demonstrated the ease of development offered by scripted web pages. The addition of VB COM components handled the intensive tasks. This combination allows for fairly rapid development, with compiled code providing increased speed where necessary. With my personal web site, I do not expect to have traffic that would require compiled code. It is possible some portions in the future may be compiled, but I expect that to be the exception more than the rule. As for the Microsoft tools, I am also reluctant to spend the money required to license the servers and development tools for creating and running a personal web site. That is not to say that I will not do that in the future, only that I have not done it for a while. During my independent consulting days as BSoft Productions, I did have a Microsoft MSDN subscription. When that was no longer tax deductible as a business expense, the subscription and the expense ended. Now that ASP.Net works with C#, it may be worth making the investment again. But, I digress. The use of Microsoft technologies raises again the cost factor, which can be substantial. ACS was cost prohibitive due to Oracle and the skills to be gained using Tcl and AOLserver technologies used by OpenACS were not quite marketable enough. Web technologies have changed since then as they continue to do. The ease of development offered by scripted languages such as Perl and Tcl continue with new languages being added. One such language is PHP. After some experimentation with it, I decided to rework my web site using PHP as the basis. A web server running Linux, Apache with mod_PHP and using PostgreSQL for the database provides the capabilities for hosting a dynamic web site while still offering the low cost factor. With the growing popularity of PHP, the skills may have future marketability also, though possibly not as much as with Microsoft technologies. However, in order to pay now to earn later, you need to be able to pay now, which I cannot afford at the moment. The choice I made should be a nice compromise for personal use. While the syntax may be different, PHP web pages offer scripted classes and inheritance. I have heard that ASP.Net and C# offer this as well. Though I have not yet had a chance to work with the .Net technologies, I plan to do so when the opportunity presents itself, but I digress again. Current implementation Over a couple days time, I made some changes that will provide a framework for future enhancements. The first change was to add the Gallery software to allow for easily adding images and albums without requiring code changes. The second change was a bit more drastic, replacing the static HTML pages with a framework written using PHP. This framework is based primarily on the support of classes and inheritance offered by PHP. There is a base class for a Page, which the individual pages inherit from. Supporting the Page class is a Breadcrumb class and replaceable PageSection derived classes. The class inheriting from Page provides the actual content for the pages. The PageSection derived classes, PageTop, PageCenter and PageBottom, serve a supporting role to the Page classes. The use of CSS and replaceable pages and page sections derived from common base classes allow for easily changing the look of the entire site. The next article will have more details on the beginnings of the framework. Proposed enhancements The quick, two-day change is just the start of the work I have planned. While the use of a pre-written PHP framework may allow for a more rapid implementation, it would not provide the educational experience I also desire. Besides, I am not even sure such a framework exists and searching for it has not been a priority. A few of the changes I have planned are to use the database for data storage. The first few changes are for the articles, links and bookshelves. I will provide more details on these in future articles, but here is a quick overview. Articles: The current implementation for articles includes the page contents by reading the data from a static file. This was the quickest change from static HTML to using PHP, but does not provide the dynamic nature I wish for. The article data needs to be stored in a database according to topic. The first iteration will likely have the entire page data stored. Eventually, I would like to store different segments of the articles separately to allow for better formatting capabilities. Links: Maybe I have too many. I definitely have too many that have gone stale. Moving them to the database will provide an easier way to manage this. A regularly running script can check the database for stale links, marking which ones have possibly gone stale or are just having the site reworked. After being stale for a time, they can be automatically hidden and marked for removal. Bookshelf: I had started creating bookshelves to track some of the books I have on my shelves. As with the articles, I have books on many different topics. To present some of these on the web site, a database would provide an easier way to add new books without having to modify the pages to do so. I would like to have the ability to add new book entry simply by entering an ISBN number. The admin pages should be able to find the cover images to use for creating the links. Conclusion This seems like a lot of work for a personal site and it is given the time constraints of family life. While some individuals may benefit from the information presented, I feel I benefit the most. The educational experience alone is worth the effort. Besides, maybe the framework will become good enough to share or, at a minimum, others can learn from my mistakes.