Hi, is there a way to prevent users using IE 6 from accessing my website and displaying a message for them saying that the website is not compatible with IE 6?.. Any help will be appreciated.. thank you
I second that. This is silly, mate. Learn how to code properly. That way your site will look the same way on every web browser, even on IE6.
It would seem silly, unless your niche was to get people to switch from one to the other. But that's a niche I sure would not want to be in.
Yes fix your badly coded page, java popup, php user agent detection, etc. Or huge banner at the top stating you hate ie6 or ie6 users suck or the like i use ie6 btw since i like checking for bugs in pages i code... Only big drawback i hate about ie6 is no support for transparent pngs and of course the stupid double left margin bug.
This is very silly, but heres the code if you have to use it: <?php // check which browser your using.... $useragent = $_SERVER['HTTP_USER_AGENT']; if (preg_match('|MSIE ([0-9].[0-9]{1,2})|',$useragent,$matched)) { $browser_version=$matched[1]; $browser = 'IE'; } elseif (preg_match('|Opera/([0-9].[0-9]{1,2})|',$useragent,$matched)) { $browser_version=$matched[1]; $browser = 'Opera'; } elseif(preg_match('|Firefox/([0-9\.]+)|',$useragent,$matched)) { $browser_version=$matched[1]; $browser = 'Firefox'; } elseif(preg_match('|Safari/([0-9\.]+)|',$useragent,$matched)) { $browser_version=$matched[1]; $browser = 'Safari'; } else { // browser not recognized! $browser_version = 0; $browser= 'other'; } if($browser == 'IE'&&$browser_version=='6') { echo 'PUT IN REDIRECTOR OR CODE TO SAY ITS IE6'; } else { //Go on with the page } ?> PHP:
Thank you for the code...it's working fine but Avast is catching a virus (Malwar name:HTML:Malware-gen) whenever the website is accessed using ie6.
Just put an IE conditional comment, and put a meta refresh in there linking to a "this page doesnt work in IE6" .html file
Yes you can either use CSS, or find the users browser information via PHP or even JavaScript. Why not do this but just use it to display a message alerting on the users out of date browser rather than eliminating them altogther
Because IE 6 is vulnerable to many things such as active-x control and etc, and it can be called a hi-jacker to many AVs.
You got the best solution rochow.. thank you all for your generous help. You can consider the thread closed.