Welcome to WebmasterWorld Guest from 54.211.101.8

Forum Moderators: coopster & jatar k

Detecting NN4 with PHP

Foolproof method?

   
2:46 pm on Oct 29, 2002 (gmt 0)

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Hi all,

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 ;)

Nick

5:47 pm on Oct 29, 2002 (gmt 0)

10+ Year Member



Give the get_browser() function a try:
[php.net...]
6:05 pm on Oct 29, 2002 (gmt 0)

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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)

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Thanks. dosn't appear that my host has a browscap.ini installed though....

Nick

6:10 pm on Oct 29, 2002 (gmt 0)

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member



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....

Nick

7:03 pm on Oct 29, 2002 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Nick_W,

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.

Jim

7:08 pm on Oct 29, 2002 (gmt 0)

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Agreed. I can live with a few mistakes though. If I catch most of them that will be okay...

Nick

 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month