Redirect Ie Users

liunx

Guest
I'm building a site and I don't care if IE users can see it properly (for now, maybe), but I'd like to tell them that they aren't going to see it properly unless they switch to a more compliant browser. Is there some kind of script I can put in my headers that will allow me to notify the user that he should switch from IE, and then if he wants, let him continue on to the site?<!--content-->
Hi Tim,<br /><br />You might try PMing TCH family member Borfast (Raul), I know that he used to have a script on his site that would notify IE users that they needed to use a different browser to view his site.<!--content-->
Yes, and its probably easier than you think.<br /><br />Depending on if you are using javascript or php or whatever, you basically just have the script check for which browser the user is using, and then you have a simple If/else check. If the browser is IE, show warning. Else show the normal page to everybody else.<br /><br />You should be able to find a quick script that will get the browser name (depending on your scripting language), and then you can write the if/else test.<!--content-->
Oh, and I've seen Raul's site, and he did a good job with it, so like GroovyFish said, if you have specific questions, I'm sure he'd be happy to help.<!--content-->
A simple Javascript like<br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><script LANGUAGE = "JavaScript"><br /><!--<br />if (navigator.appName=='Microsoft Internet Explorer')<br />{myWindow=window.open();<br />myWindow.location.href=http://www.totalchoicehosting.com/forums/lofiversion/index.php/"http://your_domain/redirect_page.htm"}<br />//--><br /></SCRIPT><!--c2--></div><!--ec2--><br />should work. Change the url to whatever page is ie only.<br /><br />Insert the script between the <head> </head> tags<!--content-->
Hey Tim, what a coincidence, I did exactly what you described in my site <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><br />If you visit <a href="http://borfast.com" target="_blank">http://borfast.com</a> using IE, you will be redirected to <a href="http://borfast.com/msie" target="_blank">http://borfast.com/msie</a>, which warns you about IE's problems and that it may not work well with my site.<br /><br />I used to use <a href="http://www.apptools.com/phptools/browser/" target="_blank">Gary White's PHP browser detection class</a> embedded into every page of my site and recently, since I moved my site to <a href="http://drupal.org/" target="_blank">Drupal</a>, <a href="http://borfast.com/node/166" target="_blank">I made a Drupal module for it</a>. <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><br /><br />Hope this helps! <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" /><!--content-->
 
Top