Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

DevArticles:
Making the Modular Web
Oct 01, 2003 @ 12:11:32

Over on DevArticles.com this morning, there's a new posting aimed to help you create a simple, dynamic site that's modular as well as functional. The Modular Web Page explains how.

A modular approach to page design can save time in developing and maintaining a web site. A page template may be created and the different components of the page plugged in where appropriate. No tools other than a text editor are required. This will involve "including" files within one another. Since this necessitates server-side processing some kind of server will be required. To test the code presented here we will be using a PHP enabled server.

It's good that he chooses PHP to provide this example in - not only is it easy to use, but it's also a great templating system in itself. He steps you through some sample code, creating a simple template system with includes and sets up the actual files to be included in each page. One thing I don't particularly like, though, is that he uses .inc files instead of .php files for the includes. If someone got a hold of one of those files, the web server (by default) will just display the source of the page, not parse it (major security issues)...

tagged:

Link:


Trending Topics: