473,221 Members | 1,917 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,221 software developers and data experts.

Determining if user is using Win98 & MSIE

If a user is using a combination of Win98 & any version of MSIE, I
want to display a message.
The best that I can do is the following:
<?
if ((strstr (getenv('HTTP_USER_AGENT'), 'MSIE')) && (strstr
(getenv('HTTP_USER_AGENT'), '98')))
{
echo"blah,blah,blah\n";
}
?>
Is there a better (more foolproof) way?
Thanks!
Jul 23 '05 #1
4 1411
- Dazed wrote:
If a user is using a combination of Win98 & any version of MSIE, I
want to display a message.
That's not as easy as you think it might be.
The best that I can do is the following:
<?
if ((strstr (getenv('HTTP_USER_AGENT'), 'MSIE')) && (strstr
(getenv('HTTP_USER_AGENT'), '98')))
{
echo"blah,blah,blah\n";
}
?>
Is there a better (more foolproof) way?


Yes and no. Browser Detection based on the User Agent String is very
fundamentally flawed since many browsers spoof other browsers since
sites think they need to give certain browsers messages, or totally
different pages, because they think they know what browser the user is
using.

And when using Mozilla, I can make it pass your above test even though
it is not MSIE and it is not running on Windows98. So what exactly is
the problem you are trying to solve?

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #2
Randy Webb <Hi************@aol.com> wrotc:
- Dazed wrote:
If a user is using a combination of Win98 & any version of MSIE, I
want to display a message.


That's not as easy as you think it might be.
The best that I can do is the following:
<?
if ((strstr (getenv('HTTP_USER_AGENT'), 'MSIE')) && (strstr
(getenv('HTTP_USER_AGENT'), '98')))
{
echo"blah,blah,blah\n";
}
?>
Is there a better (more foolproof) way?


Yes and no. Browser Detection based on the User Agent String is very
fundamentally flawed since many browsers spoof other browsers since
sites think they need to give certain browsers messages, or totally
different pages, because they think they know what browser the user is
using.

And when using Mozilla, I can make it pass your above test even though
it is not MSIE and it is not running on Windows98. So what exactly is
the problem you are trying to solve?

There has been an occasional site inconsistency when a user is using a
combination of Win98 & MSIE. Never with WinME, Win2K or WinXP. If they
are using a combination of Win98 & MSIE, I want to display a message
as such.
Jul 23 '05 #3
- Dazed wrote:
Randy Webb <Hi************@aol.com> wrotc:

- Dazed wrote:
<--snip-->
And when using Mozilla, I can make it pass your above test even though
it is not MSIE and it is not running on Windows98. So what exactly is
the problem you are trying to solve?
There has been an occasional site inconsistency when a user is using a
combination of Win98 & MSIE.


And what exactly is that "inconsistency"?
Never with WinME, Win2K or WinXP.
If they are using a combination of Win98 & MSIE, I want to display a
message as such.


And there lies the problem. The issue of determining browser and OS is
asked so often that it is addressed directly in this group's FAQ:

http://jibbering.com/faq/#FAQ4_26
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #4
- Dazed wrote:
If a user is using a combination of Win98 & any version of MSIE, I
want to display a message.
The best that I can do is the following:
<?
if ((strstr (getenv('HTTP_USER_AGENT'), 'MSIE')) && (strstr
(getenv('HTTP_USER_AGENT'), '98')))
{
echo"blah,blah,blah\n";
}
?>
Is there a better (more foolproof) way?

In short, no - there is *no* "foolproof way". For instance, at the
moment I have my user-agent settings changed to (hopefully) be accurate
and say I am running Mozilla under WinXP, but quite often to fool just
such tests as this I change it to claim I am using MSIE and Win2K. More
often, I simply clear as much as possible of the settings so that it
tells the server nothing at all.

Your best bet is to actually think *why* you want that test and consider
if there is an alternative that is better.
Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Cliff Wells | last post by:
Hi, I'm writing an application that needs to know if an Internet connection is available. Basically, I want to have something similar to what a lot of email clients have, where the app can work...
60
by: Fotios | last post by:
Hi guys, I have put together a flexible client-side user agent detector (written in js). I thought that some of you may find it useful. Code is here: http://fotios.cc/software/ua_detect.htm ...
6
by: Alex Rast | last post by:
First of all, this is not a programming question. I'm a user, not programming in JavaScript. I'm not, however, a novice user or even a power user - I certainly know programming intimately as well...
4
by: Randy Webb | last post by:
In trying to validate a document as XHTML Strict, and using &lt; and &gt; to display < and >, I get this message from the validator: character "&" is the first character of a delimiter but occurred as...
35
by: Dr.Tube | last post by:
Hi there, I have this web site (www.DrTube.com) which has the following DTD: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> which switches...
6
by: Andrzej | last post by:
Used to read newsgroup for answers, now have to ask for them as well. I have an application (C#, .NET 1.1) that connects to local db on MSDE 2000 SP3a (using ADO from MDAC 2.71) on one side and...
1
by: Jon Spivey | last post by:
Hi, I'm using webrequest to scrape some urls, works fine, however one url seems to be throwing an error when it doesn't recognise the user agent. So I need to set the user agent to something...
28
by: entfred | last post by:
I have the following line of html: &nbsp;&nbsp1234&nbsp;&nbsp;&nbsp;&nbsp;&nbspabc&nbsp;&nbsp;&nbspyow In Internet Explorer 6.0, the columns look ok using the above html: 1234 abcd ...
0
by: AndySummers | last post by:
Hi We have just re-written a majour asp.net project to use a user control embedded in a web page. The main dll references 3 other custom controls and so to deploy the project I copy the 4 dll's to...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.