Download New PHP & JavaScript Samples!

Hi, folks —

A few people have asked for simple examples using MobileESP. I’m most familiar with PHP and JavaScript, so I whipped up a few super basic samples.

These examples illustrate how easy it is to include MobileESP code in your web page, do a quick detect, then do something interesting. For example, some of the things you might want to do include:

  • Turn on & off features.
  • Optimize pictures, videos, and other multimedia content for a specific platform. For example, dynamically replace a Flash video with an H.234 video file for iOS devices.
  • Show a platform-specific notice or ad. For example, “You’re on a Windows Phone 7 device? Download our new app!”
  • Redirect a device to an alternate version of the web page.

The PHP and JavaScript examles follow the same user flow. Both examples are extremely simple and have a very basic setup: The user browses to a landing page that does a basic device detection. Then…

  • If it’s an iPhone Tier device (including iPod Touch, Android, WebOS, etc.), it’ll redirect to a basic web page saying, “iPhone Tier.”
  • If it’s any other mobile device (including BlackBerries, Windows Phone 7, PalmOS, and most feature phones), it’ll redirect to a web page saying, “Generic Mobile Page.”
  • All other devices will fall through the above filters to land on a page saying, “Hi! I’m a Desktop page!”

Download the MobileESP samples for PHP & JavaScript.

See a live demo of the MobileESP samples in action.


Owner of the MobileESP project. For the latest source code downloads, visit:

Posted in General, How To - PHP

Leave a Reply

Your email address will not be published.