prevent IE6 users accessing website

Discussion in 'HTML & Website Design' started by z0ro, Jun 29, 2008.

  1. #1
    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
     
    z0ro, Jun 29, 2008 IP
  2. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #2
    Sure, you can do it. But, why would you want to do such a silly thing?

    gary
     
    kk5st, Jun 29, 2008 IP
  3. Ikki

    Ikki Peon

    Messages:
    474
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    0
    #3
    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.
     
    Ikki, Jun 29, 2008 IP
  4. mdvaden

    mdvaden Active Member

    Messages:
    465
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    58
    #4
    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.
     
    mdvaden, Jun 29, 2008 IP
  5. hareeshpb

    hareeshpb Peon

    Messages:
    59
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You sure take a risk on your counter...
     
    hareeshpb, Jun 29, 2008 IP
  6. z0ro

    z0ro Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    ya maybe it's silly but does anybody know how to do it?
     
    z0ro, Jul 1, 2008 IP
  7. rochow

    rochow Notable Member

    Messages:
    3,991
    Likes Received:
    245
    Best Answers:
    0
    Trophy Points:
    240
    #7
    Put this in your CSS:

    No-one with IE6 or below will ever come back :D
     
    rochow, Jul 1, 2008 IP
  8. z0ro

    z0ro Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    any other solutions?
     
    z0ro, Jul 2, 2008 IP
  9. 007c

    007c Peon

    Messages:
    611
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #9
    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.
     
    007c, Jul 2, 2008 IP
  10. RyanDoubleyou

    RyanDoubleyou Peon

    Messages:
    86
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #10
    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:
     
    RyanDoubleyou, Jul 2, 2008 IP
  11. z0ro

    z0ro Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    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.
     
    z0ro, Jul 2, 2008 IP
  12. rochow

    rochow Notable Member

    Messages:
    3,991
    Likes Received:
    245
    Best Answers:
    0
    Trophy Points:
    240
    #12
    Just put an IE conditional comment, and put a meta refresh in there linking to a "this page doesnt work in IE6" .html file
     
    rochow, Jul 2, 2008 IP
  13. wd_2k6

    wd_2k6 Peon

    Messages:
    1,740
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    0
    #13
    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
     
    wd_2k6, Jul 2, 2008 IP
  14. RyanDoubleyou

    RyanDoubleyou Peon

    Messages:
    86
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #14
    wtf. Why would it say there is a virus on it?
     
    RyanDoubleyou, Jul 2, 2008 IP
  15. hamik112

    hamik112 Peon

    Messages:
    334
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #15
    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.
     
    hamik112, Jul 2, 2008 IP
  16. z0ro

    z0ro Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #16
    You got the best solution rochow..
    thank you all for your generous help.
    You can consider the thread closed.
     
    z0ro, Jul 4, 2008 IP