Yeah, I was thinking of writing up a javascript function to do all of this,
but considering one of the browsers I use to test is Amaya & Amaya doesn't
even recognize javascript as anything other than extra garbage I was looking
around for a way to do it on the server.

I installed the newest version of php & noticed the browscap.ini file (yeah,
I've played with this file with IIS & the previous version of php, but I
didn't think about it).  So I looked up browscap.ini on php.net & found this
nifty little function - get_browser() - which compares the info in the
browscap.ini file to what the browser sends you. Only problem with this is
if your browscap.ini file is incomplete or has missing info (konqueror is
not listed as having a platform = Linux, even though Linux is part of the

If anyone knows where there might be a full listing of the browscap.ini file
somewhere, please let me know! :)  My linux box is down for a bit as I'm
swapping some hardware around, until it's finished I'm stuck trying to
compare files manually on win boxes I think :(

Heh, I only found this out after I spent several hours working on writing
several functions using eregi to find stuff...  with no success.  Then again
I am pretty pathetic in using ereg/eregi to find more than a couple

Thanks for your help guys :)


----- Original Message -----
From: "Chris Garaffa" <[EMAIL PROTECTED]>
To: "Erik Price" <[EMAIL PROTECTED]>; "Patrick Teague"
Sent: Thursday, June 27, 2002 5:20 PM
Subject: Re: [PHP] Detecting Browser Type/OS from HTTP_USER_AGENT

> Erik,
> While I agree in principal, you must remember that not all UAs (User
> Agents) comply with the Standards, especially newer ones like XHTML,
> CSS 2, etc. Even a somewhat mainstream UA, like OmniWeb, for example
> (because I've been having problems with it lately) will not render
> your page the same as, say, IE or NS4 or the Gecko engine.
> --------
> Patrick,
> To answer your question without coding for you, search some
> JavaScript sites for UA detection scripts. Then, translate them into
> PHP (I'd say just use the JS, but 1: Not all UAs support JS, 2: those
> who do support JS may have it turned off by user preference, and 3:
> this is, after all, a PHP list ;)
> I once saw a beautiful script which detected everything from Netscape
> to IE to Sun's UA to Amaya to Opera, iCab, OmniWeb, Mozilla,
> Konqueror, WebTV, etc, and versions of each, too, then grouped the
> UAs together by capability (which standards they support/do not
> support), and redirected appropriately. I, unfortunately, cannot
> remember where I saw this script. May have been at www.javascript.com
> (there are some good ones there). Or, try builder.com's Web Builder
> Library.
> --
> Chris Garaffa
> At 9:58 AM -0400 6/27/02, Erik Price wrote:
> >On Thursday, June 27, 2002, at 08:57  AM, Patrick Teague wrote:
> >
> >>Has anyone else done something similar to this?  The main purpose for
> >>this is to find out what clients are using the most so that we can
> >>content more specific to the browsers.  I've noticed things that work on
> >>MSIE don't look half the same on Mac MSIE, not to mention the
> >>between MSIE, Konqueror, & Mozilla.   The other reason is I have people
> >>developing stuff on Mac, Linux, & Windoze.  I'm trying to put together
> >>something sane to mesh all of these together.
> >
> >The best thing you can do is make every attempt to code to the
> >standards, and then hope that the browsers do their best to meet
> >those standards too.  You could argue with my opinion on this,
> >saying that "Well that's just not realistic because everyone's using
> >IE" or whatever, but then something like AOL's decision to use
> >Mozilla as its internal browser engine comes along and changes the
> >whole paradigm.  Boom, you now have to change your entire site
> >because now most people aren't using IE.
> >
> >Coding to the standards is your best option.  In my opinion.  Good luck.
> >
> >
> >Erik
> >
> >
> >
> >
> >----
> >
> >Erik Price
> >Web Developer Temp
> >Media Lab, H.H. Brown
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

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

Reply via email to