homepage Welcome to WebmasterWorld Guest from 54.166.148.189
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Detecting NN4 with PHP
Foolproof method?
Nick_W




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

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

 

Matt_Wade




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

Give the get_browser() function a try:
[php.net...]

jatar_k




msg:1254909
 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

Nick_W




msg:1254910
 6:06 pm on Oct 29, 2002 (gmt 0)

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

Nick

Nick_W




msg:1254911
 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....

Nick

jdMorgan




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

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

Nick_W




msg:1254913
 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...

Nick

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved