Posts Tagged ‘PHP’

How to detect a Mobile Device – Part 2: Detecting multiple devices

September 24th, 2009


Introduction
This is the second in a series of tutorials explaining how to detect mobile devices and so direct a user to a mobile optimised page.

Who is this tutorial for?
It will be helpful to have read the first in the series: Part 1: The User Agent String.

This tutorial assumes an intermediate level of PHP and xHTML

The Problem of Multiple Devices
In the last tutorial, we looked at how to detect one platform, by grabbing the user agent string, comparing it against the text for ‘iphone’ or ‘ipod’, and then redirecting to an iPhone-optimised web page.

However, there are a myriad of mobile devices in the world. Each mobile device has a browser, some of which are the same (e.g. Opera Mini, or a standard browser for Nokia Series 40), but many are different, and therefore return different user agent strings. It’s also worth noting that sometimes re-releases of the same handset will modify the user agent string slightly.

Read

How to detect a mobile device – Part 1: The User Agent String

July 23rd, 2009


This is the first in a series of tutorials that explain how to detect mobile devices, and so direct a user to the appropriate mobile-optimised webpage.

This tutorial assumes a intermediate knowledge of PHP and HTML.
Read


Switch to mobile version