Once again… detecting IE with PHP

The following is a remake of a post from my old site. I’m reposting it here due to its apparent popularity.

A friend sent me a link to explorer destroyer. It?s an interesting idea – detect whenever someone views your site with Internet Explorer and present them with the option to download Firefox. After some thought, I realized that one can use PHP to do a similar thing.

The following is a simple script that will detect if someone views your site with IE. If so, you can customize it to do whatever you want. You can praise them, heckle them, or bombard them with pop-ups. You decide.

< ?php if(strstr($HTTP_USER_AGENT,"MSIE")) { ?>

Enter all the IE-destroying HTML that you want here.

< ?php } ?>

View a text file: detect IE.