Processing HTML Pages As PHP

Phillip created popular HTML pages that I wanted to add PHP code to, to track the number of hits they’ve been getting. I didn’t want to change the file’s extension or use redirection, so I wondered if it was possible for Apache to treat HTML files as PHP files; it is: add the following to your httpd.conf file:

AddType application/x-httpd-php .htm
AddType application/x-httpd-php .html

Works like a charm. You could use that technique to hide the fact that your website is using PHP to process your pages.

The difference between <br> and <br/>

A lot of HTML references and programs are using <br/> instead of <br> lately, and I didn’t understand the difference between the two because they both do the same thing: forces a break in the current line of text.

<br/> is XHTML compliant, which states that:

Empty elements must either have an end tag or the start tag must end with />. For instance, <br/> or <hr></hr>.

So what is XHTML? It’s an enhanced version of HTML that’s compatible with XML. I ain’t going to explain XML because: 1) I don’t know it well enough to explain it, and 2) I don’t care.

Update (for Steve): So use <br/> if you want your web pages to be XHTML compliant. Right, big whoop-de-do.