Client: Our site should be “seen well” only in Internet Explorer, because it is the only browser widely used.

The agency: A website usually has one of those two purposes:

  • Helping a brand to express its message to the visitors (actual or potential clients, competitors etc.)
  • Directly or indirectly productive function, by implementing some online services. In this case we can properly quantify the ROI of a Website.

If in the first case it is more difficult to evaluate the negative impact on the company’s image caused by a Website which has a “Best viewed in IE” message, the calculation is far more simpler for the second purpose.Who would want to lose 10-20% of his customers?

So, you are now able to save time using some fancy programming, as discussed in Part 1. But I am sure you can do a lot more. The time has come to choose between working with only a few clients or having a lot of satisfied customers. If you choose the first option, please end your reading here. The rest of us will continue to dive into included files.

I hope you agree with me when I say that 90% of the Websites out there have a lot of parts that are the same in each page. Among them: the header, the footer, the navigation zone, some configuration files (connections to the database, procedures etc.). Why coding them on every single page? Why managing changes in thousands of files? And this is where the good stuff is coming in. This is how I do it, in just three simple steps:

  1. I write a test page which contains all the elements mentioned above and needed both for the content and for the design. You could take one of your pages. Any! Make sure it has no errors and everything runs smoothly.
  2. Cut the page into pieces cotaining unchanged data (see above) and save them separately in the same folder with your initial document or in a specially created folder (/include for example).
  3. Using a code like the one above, combine all the files.

Examples written in PHP:


 

Examples written in ASP:


<!--#include virtual="/include/header.asp"-->
<!--#include file="footer.asp"-->

Happy coding!

A programmer should always look ahead towards problems and should never (but never) be caught by them. Is this possible? Well, I personally think not, but it is best to be aware of as many problems as it could be possible.

The answer for many problems should be, most times, a simple script. Phrases like “Our Company has a 10 years experience” or “I am a 29 year old developer” or even a copyright notice in the footer can bring some headaches if they are not taken care of properly.

For instance, instead of publishing those using HTML (or even better, XHTML) you could use some simple PHP scripts to make your boss or your clients happy on the 1st of January, every year. This, of course, would help you work less and sleep more.

Examples written in PHP:


Our Company has a  years experience
I am a  year old developer
Copyright  -  Company name

Examples written in ASP:


Our Company has a <%=year(now())-1997 %> years experience
I am a <%=year(now())-1979 %> year old developer
Copyright  - <%=year(now()) %> Company name

So, how many outdated Websites have you seen lately?