Page Includes - Not just for the obvious

It’s long been known that Web site includes (Server side includes, PHP includes, ASP includes etc) are a fantastic tool to enable us to work smarter, rather than harder. What could be better than updating one file which in turn updates multiple pages across one Web site? Well, short of browser support for multiple backgrounds suddenly becoming available, I can’t think of a more time saving, cool feature at a Web developers disposal.

However, as with all things great, includes are not being used to their full potential. Many developers seem to think includes are for your Web site navigation, header and your footer and nothing else. That’s simply not the case!

We (me and my business partners) launched our Web hosting subsidiary company on Wednesday. (It was a two week marathon to get the company launched, by the way. It finished with us staying awake for 21 hours straight. I went to bed on Wednesday morning at 6am, just as the sun was rising). Anyway, with the company launch came our new Web sites. As is the nature of Web hosting, response times to support queries are of paramount importance, and we publish our average response time with great pride throughout our Web site. Now, it’s only a two digit figure. Nothing more. Just a number. However, it is present throughout our Web site(s), and is updated on a regular basis. Can you imagine going through each page to update that response time each time we needed to? Maybe you have the energy, but I don’t.

That’s why we put it in an include!

That’s why we put the two digit figure in a PHP include. All we have to do now is update that one file, and within a few seconds it updates everywhere it’s mentioned. No risk of missing a page. No risk of a client coming to us and getting annoyed that she’s seeing different average response time figures, and most important, we get to earn an extra hours pay from a paying client, rather than spending an hour updating our sites.

It’s the same for my entrepreneur blog that I’m working on. As a young entrepreneur, I continually mention my age (Hey, I have a big ego and I’m proud to say I own several businesses at 19). So, again, I included that two digit figure in an include. Once I hit 20, I just need to update the include and hey presto, my Web site displays accurate information.

Includes are not just for your menu, header and footer. They can be used throughout your Web site.

Don’t work hard. Work smart!

Further reading:
Server Side Includes (SSI) - http://www.htmlhelp.com/faq/html/design.html#include-file
PHP Includes - http://www.tizag.com/phpT/include.php
ASP Includes - http://www.w3schools.com/asp/asp_incfiles.asp