Friday, August 17, 2007

Detecting an iPhone Server-Side in ColdFusion

For those rare birds who do there server sided scripting in ColdFusion or ColdFusion MX, here is a snipet of code to determine if your user's coming to the site on an iPhone:

<cfset sInfo="You are NOT using an iPhone.. Bah!">
<cfif Find("iphone;",LCase(CGI.ALL_HTTP)) GT 0>
   <cfset sInfo="Hurray! You are using an iPhone!">


Temperary spot for my test page: http://chomer.com/iphone/games/icheck.cfm

Run it on your iPhone, then run it on something else!


  1. hi any idea from detect blackberry and nokia movil? in this option (Find)


  2. Sorry, I've never worked with those devices before. One thing that you could do is create a simple ColdFusion web page that displays the contents of CGI.ALL_HTTP:


    , go to it from device and see what comes up!

  3. Fantastic! congratulations for your work and ideas.
    ColdFusion Downloads


Note: Only a member of this blog may post a comment.