Re: Headers on smart phone browsers
| From: | Marc Guay | Date: | Mon, 06 Feb 2012 15:44:14 +0000 |
| Subject: | Re: Headers on smart phone browsers | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-316472@lists.php.net to get a copy of this message | ||
> 1) Do smart phones use the same browsers as the desktop, or do they have
> their own stripped down versions of browsers?
Different browsers, some of which are worse than IE (see Blackberry).
> 2) When a browser broadcasts its header telling the server what kind of
> browser is involved, do they broadcast anything in the header to
> indicate that they're being run on a smart phone?
Nothing so specific or easy to identify as "i am a smartphone".
Depending on your target audience, simple regex checks for the strings
"iphone", "android", etc. can do the trick, but if you want specific
details about the device...
> 3) Bonus question: Is there a preferred method amongst coders to
> determine what type of environment is being browsed from, so as to serve
> up the proper type of page (desktop or smart phone version of a
> webpage)?
... the WURFL database and things akin to it or based on / stolen from
it can help parse the header string and return a plethora of
information about it (screen size, AJAX ability, markup capacity,
etc).
Marc