Browser upgrade script?

Hello there,

I am having troubles with a Suckerfish menu in IE 6 and increased the z-index.
Here is the link:

I am wondering if there is anything availble that detects which browser you are using and it’ll tell you that you need to install a newer browser.

I’ve been told it is a server script.

Many thanks

You can only do it client side and only with Internet Explorer (using Microsoft’s conditional comments).

It isn’t going to be of any help to anyone though because everyone who can has already upgraded from IE6. Those still using it are locked in due to the requirements of their company intranet.

Erm you can use php for example to check what browser is being used and the version.

That can’t be relied upon as browsers can be set to give a different user agent.

PHP can only test the useragent and has no way of telling what the browser is. What browser is it when the useragent reads “Eat At Joe’s”?

Since Internet Explorer and Firefox can both set the useragent to anything at all there is no way of distinguishing between those two browsers by using the useragent.

Since Safari, Chrome, Opera, and many other browsers can set their useragent to identify themselves as Internet Explorer or Firefox (sometimes automatically without the browser user’s knowledge) there is no way to tell what the browser is if the useragent says Internet Explorer or Firefox since it can say that for ANY browser.

The ONLY two places where it is possible to distinguish the browser accurately is with HTML or JScript conditional comments. Since only Microsoft programs such as Internet Explorer and Office support HTML conditional comments you can use those conditional comments in the HTML to test for specific versions of IE or Office. Since IE is the only browser to run JScript instead of JavaScript you can also use JScript conditional comments to test for the browser being IE.

While all of the above posters are correct, and there is no way to ensure that the user agent will accurately tell you which browser is being used by a client, it can still be somewhat useful. On my own site I use a combination of server side php using the browsecap.ini file to determine browser capabilities,, as well as no-script tags on the client side to inform the user if they are using a javascript compatible browser that has javascript disabled.

For most users this is sufficient; the main justification for implementing such a script for me was to inform users using antiquated browsers like IE 6 that newer versions exist which would improve their experience. Most of these users likely don’t have the savy to be modifying their user agents.

On a semi-related note, one thing to watch out for if you use any flash on your page, is that flash will report a different user agent from the browser it is running in.

Here’s a good script you could use:

It’s a client-side script, not a server-side script, but I think it’s what you’re looking for.

That script requires jQuery in order to function. Definitely overkill for what can be done with a line of HTML.

<!--[if IE 6]><p>I am sorry that you are unable to 
access this site because I am too lazy to make sure it works
for those who are still forced to use IE6.</p>

Javascript should not be relied up for determing what browser (and version) a person is being used as some people may well have javascript blocked.