Subsribe to our RSS

latest reactions

christian louboutin shoes
With that kind of traffic you want to ad …
Rahul Anand
Thanks for the nice post. It works for m …
Serkan
thx a lot! …
msb
Thanks for above solution.There is ano …
Lori S.
FYI, I was using this successfully in CF …

Use OpenDNS

mxna feeds

Interview with ProGit Author, Scott ChaconColdFusion 9 Developer TutorialColdFusion MeetUp: Digging Into The Developer Toolbox, with Jim PriestColdFusion MeetUp: Using jQuery as a Proxy to ColdFusion, with Hal HelmsColdFusion Job Opportunity in Lexington, MAColdFusion Job Opportunity in Washington, DCColdFusion Job Opportunity in Rye, NYConfiguring Apache To Use Multiple Versions of ColdFusionFun with Decentralised Version ControlEscaping Form Values - Understanding The ColdFusion htmlEditFormat() Life CycleColdFusion Job Opportunity in Limburg, BelgiumColdFusion Job Opportunity in Colchester, Suffolk, United KingdomColdFusion Job Opportunity in Houston, TXUpdate to my 911 ViewerColdFusion Job Opportunity in Chico, CA

All files are strictly confidential: all information is classified.
© Copyright 2002 - 2010 mximize.com.
All right reserved.

MXNA webfeed

Visit Carlos Gallupa

Simple, but effective mobile redirect function

<cffunction name="isMobile" returntype="boolean">
    <cfset var ret = false />
   
    <cfif cgi.http_accept contains "text/vnd.wap.wml" || cgi.http_accept contains "application/vnd.wap.xhtml+xml" || structKeyExists(cgi,"HTTP_X_WAP_PROFILE")>
        <cfset ret = true />
    <cfelseif findNoCase("iphone", cgi.http_user_agent)>
        <cfset ret = true />
    </cfif>
   
    <cfreturn ret />
</cffunction>

<cfoutput>
    Is it a mobile? #yesNoFormat(isMobile())#
</cfoutput>

4290 viewed | 2 opinion(s)  | del.icio.us | Digg it | Tjarko @ 01/02/09 22:21 cet


Reactions:

Idel wrote.... (site)

I suggest to use the Apache Mobile Filter, this apache module give all information about the device as environment variables. And also its render the images to the screen size of mobile devices.
Is an open source project, it is free and you can use with every language you want.

For more info:http://www.idelfuschini.it/apache-mobile-filter-v2x.html

14 May 2009 22:55 cet  

Lori S. wrote....

FYI, I was using this successfully in CF 8, but under ColdFusion 9 you'll need to change:

structKeyExists(cgi,"HTTP_X_WAP_PROFILE")

To:

CGI.HTTP_X_WAP_PROFILE IS NOT ""

This is because under CF 9 ColdFusion always returns true when it tests for the existence of a CGI variable.See the CGI environment variables page in the online CF 9 documentation for info.

09 June 2010 19:56 cet  

Leave your comment

Your name


Your url/website/link/email....


Some room for your reaction is placed here..



The answer to the ultimate question is?? (42 ;-))




URL en mail addresses are translated for you... life sometimes is that simple!!