Device Check

NEWS & TIPS

  • Site Access Keys
  • Top: Alt+t
    Previous: Alt+,
    Next: Alt+.
    Up: Alt+;
    (Note: use Ctrl on the Mac)

Device Check Redirect

Author: Andy Gardner

1. Introduction

This script allows users to be redirected to a different web page if they are viewing from a mobile media device.

*You must have PHP 5 or later.  Only those versions support SimpleXML, which is required for this script to operate.

2. Components

The only component that should need to be altered is the configuration file.

The components are as follows.

3. Configuration

The configuration file specifies the target that the page for mobile devices uses.

4. Data Definition

This is the XML necessary to generate the above configuration file.

5. The Script

The script checks to see if the visitor is using one of the following browsers:  Mozilla, Firefox, IE, Opera, and Safari.  If he/she is, then nothing happens; otherwise, he/she is redirected to the mobile page.

  1. device-check-PHP.zip
    This zip file contains the necessary scripts and XML for PHP.
  2. device-check-redirect-php.txt
    This is the main PHP script that checks the header agent.
  3. device-check-redirect-config.xml
    This is an example XML config file.
  4. device-check-redirect-config-data-def.xml
    This is a data definition to visually configure the XML config file.
Last modified on Tue, 11 Sep 2007 14:52:47 -0400

Top / Up / Table of Contents