User Tools

Site Tools


wiki:software:code:php:browserid

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
wiki:software:code:php:browserid [2022/09/18 23:41]
claire
wiki:software:code:php:browserid [2022/09/26 17:21] (current)
claire ↷ Page moved from wiki:software:php:browserid to wiki:software:code:php:browserid
Line 1: Line 1:
 ====== PHP: Browser identification ====== ====== PHP: Browser identification ======
  
-<adm abstract Old blog post> +{{template>util:​oldblog|date=August 22, 2008}}
-This article was originally published on August 22, 2008+
-</​adm>​+
  
-Not too long ago, I wrote a [[wiki:​software:​cfm:​browserid|short tutorial on using ColdFusion to identify the user’s browser and add extra browser-specific CSS files]]. Today, I found myself in need of similar functionality for PHP. The code isn’t quite the same – PHP doesn’t have a direct clone of CF’s ''​contains''​ decision operator; you have to use the ''​strstr''​ string function instead. The general idea, however, is the same.+Not too long ago, I wrote a [[wiki:​software:code:​cfm:​browserid|short tutorial on using ColdFusion to identify the user’s browser and add extra browser-specific CSS files]]. Today, I found myself in need of similar functionality for PHP. The code isn’t quite the same – PHP doesn’t have a direct clone of CF’s ''​contains''​ decision operator; you have to use the ''​strstr''​ string function instead. The general idea, however, is the same.
  
 The following script will identify between Firefox, IE6, and IE7. Like my last post, I’ve added an extra piece that will include an ''​ie.css''​ file before including an IE version-specific stylesheet. The following script will identify between Firefox, IE6, and IE7. Like my last post, I’ve added an extra piece that will include an ''​ie.css''​ file before including an IE version-specific stylesheet.