Since my site (domesticat.net) is skinned, I use PHP to test for a handful of browsers that require certain types of skins. In practice, this points lynx browsers to the lynx skin, and the PDA-type browsers to the ultralight skin.
Zalary (of everythingfalls.com) emailed me this morning to let me know that I'd made a goof, and that one of the text strings I was testing for now trips up under a Mac-based browser, Avant, that I'd never heard of before.
So, I thought I'd 1) pass along what I've found so far and 2) ask for any obvious browser strings I've missed.
Here's the code that I'm using now (insert usual disclaimers here about how this is PHP):
<?
if ((stristr($_SERVER['HTTP_USER_AGENT'],"palmos")) or
(stristr($_SERVER['HTTP_USER_AGENT'],"blazer")) or
(stristr($_SERVER['HTTP_USER_AGENT'],"wap")) or
(stristr($_SERVER['HTTP_USER_AGENT'],"avantgo"))) $skin = "13";
if (stristr($_SERVER['HTTP_USER_AGENT'],"lynx")) $skin = "3";
?>
(Everything between the 'if' and the ; is one line; if you're going to use this code, you'll need to take out those line breaks. I did it this way for easier reading.)
Short and sweet – if a case-insensitive check of the http_user_agent turns up matches against PalmOS, Blazer, WAP, or AvantGo, we're probably looking at a PDA user. (I previously tested for just 'Avant', and that's what tripped up Zalary's browser.)
Are there any common PDA browsers I've missed here? Since I don't do PDA-based browsing, I'm afraid I'm a little out of the loop on this issue.