note 10662 deleted from function.get-browser by irc-html
| From: | irc-html@php.net | Date: | Mon, 21 Jan 2002 00:45:56 +0000 |
| Subject: | note 10662 deleted from function.get-browser by irc-html | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-25593@lists.php.net to get a copy of this message | ||
if (strstr(getenv('HTTP_USER_AGENT'), 'Mozilla'))
returns true for both Netscape and IE.
Here's what I got when I echoed $HTTP_USER_AGENT in 3 different browsers:
Netscape 4.08: Mozilla/4.08 [en] (Win98; U ;Nav)
Internet Explorer 5.5: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)
Neoplanet 5.2: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)
So instead of testing $HTTP_USER_AGENT for "Mozilla" try testing for "Nav" if
you want to check if the user's browser is Netscape.