Reece S Posted February 19, 2008 Share Posted February 19, 2008 Hi, I am looking for a code that will let all other browsers navigate my website normally, but basically tell IE to get lost. I have had many problems over the years with IE, and its unique display. I thought that if I blocked access to my site when browsing on IE, it would help out greatly. I am hoping for a HTACCESS code, if not, then maybe something I could put on the header of every page, EXCEPT the one PPL get redirected to (obviously so it doesn't go into a loop) Sorry if this sounds confusing, here, i make it simple: "Is there a code to prevent access to a website when using Internet Explorer?" Thanks in Advance for any info. Quote Link to comment https://forums.phpfreaks.com/topic/91970-deny-access-specified-browsers-ie/ Share on other sites More sharing options...
Psycho Posted February 19, 2008 Share Posted February 19, 2008 You want to prevent 55% of all users from accessing your site? Interesting. You could use the $_SERVER['HTTP_USER_AGENT'] predefined variable to determine the browser. Quote Link to comment https://forums.phpfreaks.com/topic/91970-deny-access-specified-browsers-ie/#findComment-471075 Share on other sites More sharing options...
suttercain Posted February 19, 2008 Share Posted February 19, 2008 Wow... that is a hostile move. But yeah use the $_SERVER['HTTP_USER_AGENT'] and use an if statement... Please post a link when you have git this up, I want to see... Quote Link to comment https://forums.phpfreaks.com/topic/91970-deny-access-specified-browsers-ie/#findComment-471078 Share on other sites More sharing options...
monkeypaw201 Posted February 19, 2008 Share Posted February 19, 2008 Reese; The following post is NOT making fun of you or your question in any way, it is just a curiousity. If you can block IE, is it possible to block anyone running Windows? ~Monkeypaw (Linux Geek) Quote Link to comment https://forums.phpfreaks.com/topic/91970-deny-access-specified-browsers-ie/#findComment-471081 Share on other sites More sharing options...
Reece S Posted February 19, 2008 Author Share Posted February 19, 2008 Yh, i was just thinking how foolish this may be. I have always forced my friends ito using FF, or other stuff, then got quite used to seeing that on screen, not actually thinking about the outside world OK, maybe a more sensible move would be to use a php string? something like: If "Internet Explorer" echo "message"; else echo"Welcome"; I know this aint real PHP, its just an idea. I CBA to type real coding. but is this possible? Quote Link to comment https://forums.phpfreaks.com/topic/91970-deny-access-specified-browsers-ie/#findComment-471101 Share on other sites More sharing options...
suttercain Posted February 19, 2008 Share Posted February 19, 2008 What I did when I was having major IE6 CSS issues was create a basic if ie6 echo "We highly suggest upgrading to IE7 or Firefox". While it didn't fix the problem, it let users know they could update browser to take care of the visual issues. SC Quote Link to comment https://forums.phpfreaks.com/topic/91970-deny-access-specified-browsers-ie/#findComment-471112 Share on other sites More sharing options...
Reece S Posted February 19, 2008 Author Share Posted February 19, 2008 Never mind I decided to venture into a bit of javascript, and wrote this: <SCRIPT language="JavaScript"> var browserName=navigator.appName; if (browserName=="Microsoft Internet Explorer") { alert("Browser Incompatible - Firefox Needed"); } </SCRIPT> I just hope it dont crash on me Cheers for ur time though, very grateful. Quote Link to comment https://forums.phpfreaks.com/topic/91970-deny-access-specified-browsers-ie/#findComment-471155 Share on other sites More sharing options...
cooldude832 Posted February 19, 2008 Share Posted February 19, 2008 I am going to point you to http://www.webstandards.org/files/acid2/test.html try it in IE and FF and realize that neither browser is right because acid2 is what is considered the perfect rendering. So if you want to put some blame somewhere spread it around. (fyi I do use FF2 and grand paradiso) Quote Link to comment https://forums.phpfreaks.com/topic/91970-deny-access-specified-browsers-ie/#findComment-471158 Share on other sites More sharing options...
Reece S Posted February 19, 2008 Author Share Posted February 19, 2008 hmm, interesting... I shall look into this cheers. BTW, I have devised a perfect (and unique) way of bugging IE lovers take a look: compare with any browser EXCEPT IE, then, once you satisfied it works ok, try it again with IE It still works, but boy does it bug them tell me what you think. PS: before you say I will lose visitors, I already know, but I have always made a point of opposing MS, let alone their crappy browsers, so anyone cooperating with that company doesn't deserve a relaxing surf if they think they can show their face on our website (I call that 2 faced) Quote Link to comment https://forums.phpfreaks.com/topic/91970-deny-access-specified-browsers-ie/#findComment-471175 Share on other sites More sharing options...
Reece S Posted February 19, 2008 Author Share Posted February 19, 2008 cooldude832: that site is very good. I tried it in 3 of my 6 browsers, and only Opera displays perfect (I was gobsmacked at FF) Quote Link to comment https://forums.phpfreaks.com/topic/91970-deny-access-specified-browsers-ie/#findComment-471176 Share on other sites More sharing options...
cooldude832 Posted February 19, 2008 Share Posted February 19, 2008 That site is very good, its considered the official standard to web browsers based on the initial intention of xhtml tags and css. Its what tells w3 what it should/shouldn't do Quote Link to comment https://forums.phpfreaks.com/topic/91970-deny-access-specified-browsers-ie/#findComment-471179 Share on other sites More sharing options...
dave420 Posted February 20, 2008 Share Posted February 20, 2008 Or you could just code it to work with IE and make your point without blocking most internet users out there. Most IE users aren't IE lovers, they are just using IE because that's all they have. Quote Link to comment https://forums.phpfreaks.com/topic/91970-deny-access-specified-browsers-ie/#findComment-471511 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.