Ask Dave Taylor
  • Facebook
  • Instagram
  • Linkedin
  • Pinterest
  • Twitter
  • YouTube
  • Home
  • YouTube Videos
  • Top Categories
  • Subscribe via Email
  • Ask A Question
  • Meet Dave
  • Home
  • Apple iPad Help
  • How can I auto-detect that someone’s on an Apple iPad?

How can I auto-detect that someone’s on an Apple iPad?

April 3, 2010 / Dave Taylor / Apple iPad Help, HTML & Web Page Design / 3 Comments

I’m working on my Web site and now that the Apple iPad is out, I’d like to customize my greeting for people using that device. How can I auto-detect that they’re on an iPad?

There are a ton of tools to help you with this particular task, and I’ve written about it before too (see How to detect an iPhone web browser). The basic idea is that every Web browser on every hardware platform sends what’s called a USER_AGENT identifier. Almost all of the time they’re accurate, but some test browsers have the ability to pretend they’re something else (known in the biz as “spoofing”, actually).
On my Mac OS X system, for example, when I am hitting Web pages within Google’s Chrome browser, here’s what is sent to the Web server for each and every transaction I do, whether an HTML page, PHP search result or even ask for a photo or other image:
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-US) AppleWebKit/533.2 (KHTML, like Gecko) Chrome/5.0.347.0 Safari/533.2
You can check your Web browser too. Just pop over to Microsystools and find out.
Now, the question of the moment is, what string does it show when you’re on an Apple iPad?
Here’s the answer:
Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version /4.0.4 Mobile/7B367 Safari/531.21.10
Pretty ugly, really, but the key thing to notice is that the first word within parens identifies the hardware platform. If you’re writing code of some sort, simply grab the USER_AGENT string, then check that first word.
Oh, if you’re on an iPhone and you go to the same page, here’s the USER_AGENT you are sending on each query:
Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_1_3 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version /4.0 Mobile/7E18 Safari/528.16
Good luck!
Looking for iPad help? Good news; you’ve found it!

About the Author: Dave Taylor has been involved with the online world since the early days of the Internet. Author of over 20 technical books, he runs the popular AskDaveTaylor.com tech help site. You can also find his gadget reviews on YouTube and chat with him on Twitter as @DaveTaylor.

Let’s Stay In Touch!

Never miss a single article, review or tutorial here on AskDaveTaylor, sign up for my fun weekly newsletter!
Name: 
Your email address:*
Please enter all required fields
Correct invalid entries
No spam, ever. Promise. Powered by FeedBlitz
Please choose a color:
Starbucks coffee cup I do have a lot to say, and questions of my own for that matter, but first I'd like to say thank you, Dave, for all your helpful information by buying you a cup of coffee!

3 comments on “How can I auto-detect that someone’s on an Apple iPad?”

  1. ansia says:
    May 22, 2012 at 7:42 pm

    that s what i was looking for…! thanks

    Reply
  2. sam says:
    June 1, 2010 at 1:39 am

    I also need to redirect iphone users to a html version of the site since flash isn’t read by apple iphones!
    but I need a HTML code to do that since my index page is in html and all the other php etc etc seem not working (
    please Help!

    Reply
  3. Carlos Cardona says:
    April 5, 2010 at 9:49 pm

    Thanks for this post! Very useful.
    I created a small tutorial that shows how to detect the ipad browser and redirect to an appropriate directory.
    http://cardonadesigns.com/wordpress/2010/04/04/using-php-to-detect-the-ipad-user-agent/

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search

Recent Posts

  • Guide to Adding Fingerprint Login to a Windows PC
  • How Can I Use Generative AI to Write Better Email in Gmail?
  • How Can I Hide Recent Apps and Docs on my Mac System?
  • Guide to Pairing Bluetooth Headphones with a Chromebook
  • How to Use Twitter Reply-to-DM Features and New Reaction Emoji

On Our YouTube Channel

Monster DNA MAX Wireless Speaker -- DEMO & REVIEW

Eufy Security 5-in-1 Smartlock Deadbolt -- INSTALL, DEMO & REVIEW

Categories

  • AdSense, AdWords, and PPC Help (106)
  • Amazon, eBay, and Online Shopping Help (166)
  • Android Help (234)
  • Apple iPad Help (150)
  • Apple Watch Help (53)
  • Articles, Tutorials, and Reviews (346)
  • Auto Tech Help (19)
  • Business Advice (200)
  • ChromeOS Help (38)
  • Computer & Internet Basics (789)
  • d) None of the Above (166)
  • Facebook Help (384)
  • Google, Chrome & Gmail Help (191)
  • HTML & Web Page Design (248)
  • Instagram Help (49)
  • iPhone & iOS Help (630)
  • iPod & MP3 Player Help (173)
  • Kindle & Nook Help (100)
  • LinkedIn Help (90)
  • Linux Help (178)
  • Linux Shell Script Programming (90)
  • Mac & MacOS Help (919)
  • Most Popular (16)
  • Outlook & Office 365 Help (35)
  • PayPal Help (68)
  • Pinterest Help (54)
  • Reddit Help (20)
  • SEO & Marketing (82)
  • Spam, Scams & Security (98)
  • Trade Show News & Updates (23)
  • Twitter Help (224)
  • Video Game Tips (66)
  • Web Site Traffic Tips (62)
  • Windows PC Help (963)
  • Wordpress Help (206)
  • Writing and Publishing (72)
  • YouTube Help (47)
  • YouTube Video Reviews (159)
  • Zoom, Skype & Video Chat Help (64)

Archives

Social Connections:

Ask Dave Taylor


Follow Me on Pinterest
Follow me on Twitter
Follow me on LinkedIn
Follow me on Instagram


AskDaveTaylor on Facebook



microsoft insider mvp


This web site is for the purpose of disseminating information for educational purposes, free of charge, for the benefit of all visitors. We take great care to provide quality information. However, we do not guarantee, and accept no legal liability whatsoever arising from or connected to, the accuracy, reliability, currency or completeness of any material contained on this site or on any linked site. Further, please note that by submitting a question or comment you're agreeing to our terms of service, which are: you relinquish any subsequent rights of ownership to your material by submitting it on this site. Our lawyer says "Thanks for your cooperation."
© 2023 by Dave Taylor. "Ask Dave Taylor®" is a registered trademark of Intuitive Systems, LLC.
Privacy Policy - Terms and Conditions - Accessibility Policy