search

Home  >  Q&A  >  body text

How to prevent IE browser from accessing my website? How to write the code to prohibit IE browser?

The website does not support the IE browser. How can I prompt users who use the IE browser to change the browser or directly prompt that the IE browser is not supported?

How to prohibit IE browser from accessing my website? How to write the code to prohibit IE browser?


. . . . . . . . . . . . . . . . . . . . . .

**推广网**推广网2221 days ago1875

reply all(4)I'll reply

  • BestModer

    BestModer2018-11-03 11:51:52

    Two methods:

    One is to judge the browser of the current request on the server side, otherwise it returns false

    The second is to judge through the front-end js code

    The specific code can be searched on Baidu


    reply
    0
  • **推广网

    **推广网2018-10-31 13:57:49

    It's no use. Why did you mess up the layout?

    reply
    0
  • 胤彬-

    Baidu identifies browsers with a bunch of solutions

    胤彬- · 2018-10-31 15:50:04
  • 胤彬-

    胤彬-2018-10-31 09:23:30

    <?php
    /** 
    * 检测用户当前浏览器 
    * @return boolean 是否ie浏览器 
    */ 
    function chk_ie_browser() { 
    $userbrowser = $_SERVER['HTTP_USER_AGENT']; 
    if ( preg_match( '/MSIE/i', $userbrowser ) ) { 
    $usingie = true; 
    } else { 
    $usingie = false; 
    } 
    return $usingie; 
    } 
    $i=chk_ie_browser();
    if($i==true){
    echo'你用的是IE浏览器!';
    }else{
     echo'你用的不是IE浏览器!';
     }


    reply
    0
  • Cancelreply