Page 1 of 1
Quick Browser Detection
Posted: Sun May 29, 2005 6:03 pm
by Todd_Z
What is the fastest way to detect the user's Browser. I am really only interested in detecting the big names - IE5, IE6, Fx, Netscape, AOL, etc.
I am looking for the most compact script in this case.
Thanks in advance.
Posted: Sun May 29, 2005 6:03 pm
by hongco
some javascript will do.

Posted: Sun May 29, 2005 6:11 pm
by Todd_Z
I need the answer in my php script, js won't help here.
I am trying get_browser(), but when I try ini_set( "browscap", "php_browscap.ini" ), the value still appears to be empty. Any ideas?
Posted: Sun May 29, 2005 7:25 pm
by Burrito
you could always write one with USER_AGENT and a little regex...shouldn't be too hard.
Posted: Sun May 29, 2005 10:16 pm
by JAM
Examples
here and
here...
Posted: Fri Jun 03, 2005 6:50 pm
by Todd_Z
Does anyone have a regex written for the $_SERVER['HTTP_USER_AGENT'] results?
I tried the link, it tells me that 20% of the visitors to my site are 'other'.
Posted: Fri Jun 03, 2005 6:54 pm
by programmermatt
Todd_Z wrote:
I tried the link, it tells me that 20% of the visitors to my site are 'other'.
A lot of firewalls (Norton comes to mind) can stop certain header information from being sent. This can include browser type and things like 'Previous Page' (which isn't always fun when the website requires it).
Posted: Fri Jun 03, 2005 6:57 pm
by Burrito
programmermatt wrote:
A lot of firewalls (Norton comes to mind) can stop certain header information from being sent. This can include browser type and things like 'Previous Page' (which isn't always fun when the website requires it).
you could test if this is the case by looking at the raw output of $_SERVER['HTTP_USER_AGENT']
if it is...I'm afraid your stuck, if not continue your regex quest
Posted: Fri Jun 03, 2005 7:16 pm
by Todd_Z