Forums

[resolved] Dont want my site to appear on IE6 (7 posts)

  1. Nasir Zia
    Member
    Posted 5 months ago #

    Hi,
    i am done with my site and ready to launch. But i dont want any IE6 user to visit my site. and i want a custom message for those dumb users to upgrade their browser.
    Now i know i can put some browser specific statements in my php files. But what would be the best option to just display the message and do not display any content from my site if the user visits through IE.
    in other words, i want to stop the execution of my site if you are from IE6.

    Thanks,

  2. orpatech
    Member
    Posted 5 months ago #

    <?php $browser= "1"; ?>
    
    <!--[if !IE 6]>
    <?php $browser= "0";
    
    echo "this is under if condition <br />"; ?>
    <![endif]-->
    
         <?php
    if ($browser== "0" ){
    
     echo "some message ";
    }
    ?>

    Try this code

  3. Nasir Zia
    Member
    Posted 5 months ago #

    doesn't worked.
    It changes the value of variable $browser on every browser !

  4. prionkor
    Member
    Posted 5 months ago #

    Try this:

    $using_ie6 = (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6.') !== FALSE);
    
    if($using_ie6){
       // do something
       // wp_die("please upgrade you browser, buddy! IE6? Are you Kidding me?", "Upgrade your Browser");
    }

    Ref: http://stackoverflow.com/questions/671890/can-i-detect-ie6-with-php

  5. Nasir Zia
    Member
    Posted 5 months ago #

    Thanks,
    I used `
    <!--[if lte IE 7]>
    <script language="javascript">
    window.location="http://mysite.com/update.php";
    </script>
    <![endif]-->`
    So the users with old browsers are redirected to another page... where i can write any good things for those stone age internet surfers :)

  6. prionkor
    Member
    Posted 5 months ago #

    Great! Its a javascript solution though. What about someone who using IE6 with javascript disabled ;) :)

  7. Nasir Zia
    Member
    Posted 5 months ago #

    which means i should do some meta redirection as well... :)

Reply

You must log in to post.

About this Topic

Tags