My web site want to be open IE7 and above .If IE 6 ,I want to produce warning and free download other browser icons .Is it possible?
You can get some examples that don't require server side scripting from ie6nomore.com.
They use the conditional comments feature of IE, like this:
<!--[if lt IE 7]>
Your browser is outdated!
<![endif]-->
But the examples on the site actually offer links to other browsers. Of course, you can roll your own version that suits your layout better.
Of course, you can do this server side if you prefer, since you're using PHP anyway. The other examples here using $_SERVER["HTTP_USER_AGENT"]
should get you started. Using get_browser
may be overkill, as it requires a fairly large data file to function.
If you're only interested in detecting old IE versions server side, this should do:
preg_match('/; MSIE (\d+.\d+)/', $_SERVER['HTTP_USER_AGENT'], $matches);
if (count($matches) > 1 && $matches[1] <= 6.0)
{
echo "Your browser is outdated";
}
Use IE conditional comments in your page
<!--[if lt IE 7]>
include a warning here (in an iframe, perhaps, to save extra bandwidth)
<![endif]-->
There exits a simple jQuery plugin for this it's called IE Alert. Check it out on: http://nmsdvid.com/iealert/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With