I just need to write a script that can detect whether the user is on a PDA, Cellphone or a PC. It doesn't matter whether it's a pocket pc or palm pilot, or a mac or a pc. I know how to retrieve the $_HTTP_USER_AGENT but I'm not sure what I'm searching for in that header as far as PDA's and Cellphones go.

Anybody out there have any clues??

Mahalo

    It depends on the PDA. For instance, a NetFront 3.0 Pocket PC (Palm OS 5.1) has the user agent string of: Mozilla/4.0 (compatible; MSIE 6.0; Windows 95; PalmSource) NetFront/3.0
    A Danger HipTop has the user agent string of: Mozilla/5.0 (compatible; AvantGo 3.2; ProxiNet; Danger hiptop 1.0)

    Hope this helps.

      you don't happen to know anyplace where I can get a list of the USER_AGENT strings do you?

        7 months later

        I am trying to do the same thing using the HTTP_USER_AGENT stuff, but don't know anyone with all the different pda's to find out what they all produce.

        Did you find a list of HTTP_USER_AGENT strings?

          Search for the following strings in HTTP_USER_AGENT to catch ~95% of mobile devices:

          'Windows CE'
          'Palm'
          'AvantGo'
          'Blazer'
          'ProxiNet'
          'Danger'
          'Pocket PC'
          'MIDP'
          'J2ME'
          'SYMBIAN'
          'EPOC'
          'Nokia'
          'Phone.com'
          'ericsson'
          'imode'
          'mml'
          'up'
          'wap'

            Thanks for that list.

            Where did you get it from?

            Will

              Actually, I don't know... I worked on a project a few months ago where I needed to redirect pages based on mobile devices and I just googled around until I found those. I seem to remember finding more than half of them on a PDA application development site and the others just here and there.

              I was also thinking that it may be better to use a browser resolution detection script instead of looking for matches in HTTP_USER_AGENT since you would have to continually update the string list based on new devices. I have seen JavaScript that would do that, but I’m not sure if all mobile devices can even run JavaScript.

              Maybe a combination of both solutions would work. Redirect if there is a match in HTTP_USER_AGENT and if not, check the browser resolution with JS.

              Just a thought.

              -Z

                I like the php solution as it doesn't require anything like javascript at the users end.

                I have it set to give the user a choice if there are no matches.

                Will

                  Write a Reply...