Re: Headers on smart phone browsers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 06, 2012 at 02:28:42PM -0600, Donovan Brooke wrote:

> Paul M Foster wrote:
> >This is sort of obliquely related to PHP.
> >
> >I don't have a smart phone, but I need to know a couple of things:
> >
> >1) Do smart phones use the same browsers as the desktop, or do they have
> >their own stripped down versions of browsers?
> >
> >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?
> >
> >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)?
> >
> >Paul
> 
> Hi Paul, I think this is a great PHP conversation.. and I don't
> understand why GOTO threads always get way more replies than
> something like this ;-)

See religion (n), defs 1-10.

> 
> Diverse User Agent compatibility is going to be more and more of a
> challenge for us.. gone are the days of a few known browsers that
> are viewing our sites.  From bots, to browsers, to mobile devices,
> to game UA's, to app UA's.., to IE's stubborn outlook on the web...
> the idea of user experience is growing complicated! ;-)

Well, cursory research shows there are at least 12 different major
layout engines underneath modern browsers. Multiply that by versions of
same, different OSes on which each run, versions of the OSes themselves,
etc. etc. etc. I don't envy the job of any piece of code which tries to
analyze all this. Plus, I believe that in the future, handhelds
(specifically smart phones) will approach desktops in screen
resolution.

> 
> I really liked Mari's posted link to the "a list apart" blog about
> "responsive web design" using "media query" (CSS).. however, it
> seems to me that it takes the use of many languages and techniques
> in many cases to get the job done... user agent serving (using PHP
> or JS or alike), flexible CSS and web design, and a keen eye on your
> target audience may all play apart.

Not to mention that W3C has all but abandoned its efforts to standardize
HTML5. They will likely follow the path of browsers in simple de facto
standardization.

> 
> However, this is a PHP list.. and I think we can better approach
> this topic by limiting our scope to talk about how PHP could be
> useful.
> 
> My first question, being that my first language is not PHP, is; is
> their any core PHP mobile detection functions/tools that exist?

>From what I've seen, only the get_browser() function, which depends on
the existence of a browsecap file, which may or may not be installed on
your system. And if it is, it's 300K in size, and introduces significant
latency to page loads as a result.

> 
> I have a running list of mobile UA's that I picked up somewhere that
> I often use and edit to distribute content accordingly. I also have
> a PHP mobile detection script that I picked up somewhere. I'm sure
> these things can be found via google as well. The problem, as Mari's
> link suggests, is that UA "list's" and browser sniffing scripts need
> maintaining quite regularly, since mobile UA's are being added on a
> weekly basis perhaps.

I suspect that's more as a result of everything sniffer scripts do. They
don't just detect the platform, but a variety of other things as well.

> 
> Many of my projects do some PC UA (browser) sniffing.. especially
> for IE., as IE has it's own system that it uses for how to render
> content.
> 
> Anyway, I'm happy to share what I have.. but like I said, PHP is not
> my first language, so I am interested to see what the more
> established PHP'ers may have to say.

How about this: those of you with iPhones, Androids and the like, point
your phones at a page which reports $_SERVER['HTTP_USER_AGENT'] (like a
page which runs the phpinfo() function), and post what you get back from
that exercise and what device made the query. I'd like to see if there
is anything significant which indicates handheld platforms.

Paul

-- 
Paul M. Foster
http://noferblatz.com
http://quillandmouse.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux