How do I detect a Mobile Device/Browser and redirect to another page in Coldfusion?

Hello & Happy New Year!!!!!

I was wondering how to write some Coldfusion code (I would assume it would have to go within some <script> tags?) to detect a mobile device / mobile browser and then redirect the user to another page that I already built which is mobile device friendly?

Thank you very very much in advance!!!!!!!!!!!!!
stracqanAsked:
Who is Participating?
 
Gurpreet Singh RandhawaConnect With a Mentor Web DeveloperCommented:
That is pretty much easy!!

two ways:

simple one do like this:

<cfif #CGI.HTTP_USER_AGENT# CONTAINS 'iphone' OR #CGI.HTTP_USER_AGENT# CONTAINS 'Palm OS' OR #CGI.HTTP_USER_AGENT# CONTAINS 'WAP'>
Mobile descriptive page goes here
<cfelse>
Non mobile page goes here
</cfif>

but more advanced follow this tutorial on easycfm:

http://tutorial567.easycfm.com/
0
 
stracqanAuthor Commented:
Fantastic!!! Thank you!!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.