I’m still fairly new to the mobile platform programming and I’ve never been able to find a good way to detect if you’re coming via a mobile browser or a full browser – until now. Usually what I do is put this in my normal page headers and redirect them to a mobile directory if mobile is detected.
Thanks to Ray Camden‘s suggestion, check out Detect Mobile Browser.
This site has contains open source mobile phone detection scripts for 15 languages / apps.
List includes: Apache, ASP, ASP.NET, ColdFusion, C#, IIS, JSP, JavaScript, jQuery, nginx, node.js, PHP, Perl, Python, and Rails
The ColdFusion script is pretty straight forward and uses a regular expression to figure it all out.