• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 512
  • Last Modified:

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!!!!!!!!!!!!!
0
stracqan
Asked:
stracqan
1 Solution
 
Gurpreet Singh RandhawaWeb 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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now