A dirty little browser checker

Submitted by elmer on Thu, 06/02/2005 - 6:41pm.

This tidbit just grabs the raw browser ID string from the $_SERVER variable. It looks for a couple of strings that identify IE, Opera, Mozilla, and Netscape 7.x. If it doesn't find one of these it assumes an old browser that can't deal with things like CSS and alerts the user. Finally, it sets a $_SESSION variable that can be checked later. Quick and dirty, but works for me :)

( categories: Code Samples | PHP )