| Welcome to WebmasterWorld Guest from 126.96.36.199 |
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
|Subscribe to WebmasterWorld|
|Detecting NN4 with PHP|
| 2:46 pm on Oct 29, 2002 (gmt 0)|
I need to detect NN4 with PHP but am unsure as to how best to ensure I catch any version/platform of it.
On my Linux box I get:
Mozilla/4.79 [en] (X11; U; Linux 2.4.18-5 i686)
...but it's probably different on other platforms and versions.
Any help much appreciated ;)
| 5:47 pm on Oct 29, 2002 (gmt 0)|
Give the get_browser() function a try:
| 6:05 pm on Oct 29, 2002 (gmt 0)|
the get_browser function would be fine, you can also just look at the $HTTP_USER_AGENT which get_browser uses to get the info itself.
You are just looking for Mozilla/4.x
| 6:06 pm on Oct 29, 2002 (gmt 0)|
Thanks. dosn't appear that my host has a browscap.ini installed though....
| 6:10 pm on Oct 29, 2002 (gmt 0)|
|You are just looking for Mozilla/4.x |
Right! I thought I might make mistake with something like Mozilla/4* Compatible and it turning out to be IE?
I'll re-read the function....
| 7:03 pm on Oct 29, 2002 (gmt 0)|
The problem with doing this server-side is how do you handle proxies? Many of them will come in with a UA of "Mozilla/3.01 (compatible;)" no matter what browser the visitor is actually using.
| 7:08 pm on Oct 29, 2002 (gmt 0)|
Agreed. I can live with a few mistakes though. If I catch most of them that will be okay...
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved