Sponsors

 
Showing posts with label coldfusion. Show all posts
Showing posts with label coldfusion. Show all posts

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!">
</cfif>

<cfoutput><html>
<body>
<center>
     <h2>#sInfo#</h2>
</center>
</body></html>
</cfoutput>

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


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