(Sorry for answering instead of commenting, I'm not able to comment or vote up)
I initially liked mujimu's solution. I put it on my site and it seemed to work well testing with my own iphone. However, I started testing with this http://www.mobilephoneemulator.com/ and it didn't work for a majority of devices.
Here's what I would do (and will do). Output something like this in a discreet location <cfoutput>#CGI.HTTP_USER_AGENT#</cfoutput>
. Then test and record what the devices output.
Then, use something like this (thank you Peter Boughton) and in between the pipes, use a distinct keyword from the testing...
<cfif refindNoCase
( 'distinct_keyword|android|blackberry|iphone|ipod|mobile|palm|phone|windows\s+ce'
, CGI.HTTP_USER_AGENT
)>
probably mobile
</cfif>
After my initial testing here's the list I've come up with. Please let me know if you think this is accurate...
ARCELIK,Access,Acer,Ahong,Aiko,Airis,Airness,Alcatel,AlphaCell Wireless,Amazon,Amoi,Amoisonic,Android,AnexTek,Apple,Archos,Asmobile,Aspen,Asus,ASUSTeK COMPUTER INC.,Audiovox,Becker,BEKO,Bellawave,BellWave,BenQ,BenQSiemens,BenQ-Siemens,Bird,Bleu,Blue Coat,B-Mobile,Bolt,Bytemobile,Capitel,Casio,CDM,CECT,CheckCom,Cingular,Cking,Compal,Compaq,CoralWeb,Cricket,Dai Telecom,Dallab,Danger,Daxian,DBTEL,Dicam,Dmobo,DoCoMo,Dopod,Doris,DreamPhone,EDL,Elite,ELSON,Emblaze,Emobile,Enteos,Era,Ericsson,Ericy,ETEN,EZIO,EZZE,Fitel,Fly,Fujitsu,generic,generic web browser,Generic Windows,Generic Windows Mobile,GIGABYTE,Gionee,Google,Gradiente,Grundig,Haier,Handspring,Hedy,Hei,Helio,Hewlett-Packard,Hisense,Hitachi,HP,HTC,HTC Corporation,HTIL,HUAWEI,Hummer,IAC OKWAP,IAC OKWAP Mobile Communications,Idea,iKoMo,IM,Imate,i-mate,i-mobile,Infineon,InfoSonics,Innostream,INQ Mobile,Itelco,IXI,KCM,KDDI,KDDI - SonyEricsson,KDDI-Casio,KDDI-Hitachi,KDDI-Kiocera,KDDI-Kyocera,KDDI-Panasonic,KDDI-Pantech,KDDI-Sanyo,KDDI-Sharp,KDDI-SonyEriccson,KDDI-SonyEricsson,KDDI-Toshiba,Kejian,Kisen,Klondike,KONKA,Kozi,KPT,K-Touch,Kyocera,Kyocera Wireless Corp,LCT,Lenovo,Lenovo Mobile,Lexibook,Lexus,LG,LG Electronics,LGE,Lobster,Longcos,LT,LXE,M3 Gate,Malata,MAUI-based Generic,Maxon,Medion,MicroMax,Microsoft,MIO,Mio Technology,Miracle,MiTAC,Mitsubishi,Mobile Wireless Group,MOBISTEL,Modelabs,ModelLabs,Modottel,Modu,MOMO Design,Morange,Motorola,Myphone,NEC,Neonode,Newgen,Nexian,Nintendo,Nokia,Novarra,NTT DoCoMo,NTT DoCoMo FOMA 3G,O2,ONDA,Openwave,Opera,Optimay,Orange,Palm,PalmOne,Panasonic,Panda,Pantech,PCD,Philips,PhoneOne,Pirelli-Arcor,Porsche Design,Porshe,Poseidon,Psion,QCI,QMobile,Qtek,Raks,Reporo,Research In Motion Ltd.,RIM,Robot,Ron,Rover,RT,Sagem,SAMART,Samsung,Sanyo,SavaJe,SEC,Semc,Sendo,Sharp,Siemens,Skyfire,Skyspring,Skyspring Vitelcom,Skyworth,SKYZEN,SlobTrot Software,SmartTrust,Smile,SoftBank,Sonim,Sony,Sony Ericsson Mobile Communications,SonyEricsson,Spice,Sprint,SPV,Sunrise,TCL,Techfaith,Tel.Me.,Telecom Italia,Telit,TIANYU,T-Mobile,Toplux,Toshiba,Tranxcode,TTPCom,tvCompass,tvCompass DMR1500,Ubiquam,UCWEB,Uniscope,Unistar,Uriver,Usha Lexus,Utec,UTStarcom,V3m (Metro PCS),Vacom,Velocity Mobile,Venera,Verizon,Vertu,VeryKool,VERZIOWORLD,Vitelcom,VITELCOM for Telefonica Movistar,VK,VK Mobile,Vodafone,Vodafone ZTE,Voxtel,W3C,Wapamp,Wapsilon,WAPUniverse,WellcoM,WinWAP Technologies,Wonu,XDA,Yas,Yospace Ericsson,Yospace Motorola,Yospace Nokia,Yospace Sharp,Yospace Siemens,Yospace SonyEricsson,Yulong,Zonda,ZT,ZTE,.mobi