Wednesday, 12 May 2010

PHP rendering differently from View-Source HTM

One of the obvious things to do when tackling appearance problems on a PHP page is (on Firefox) to use the "Web Developer" addin's "View Generated Source" function, copy the HTM and then save it in a separate HTM file. Then remove chunks of the page to isolate the problem.

But it isn't always that simple. Today I did this, and found that IE6 rendered the PHP version badly, but the HTM version perfectly. The error turned out to be a missing close-span tag - and I suspect that the inconsistency between PHP and HTM was because Firefox had not only forgiven the missing tag, but corrected it too.