How to prevent IE browser from accessing my website? How to write the code to prohibit IE browser?
**推广网
**推广网 2018-10-30 13:14:51
0
4
1870

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?


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

**推广网
**推广网

中国推广网 :http://bbs.iaozi.com

reply all(3)
BestModer

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


丁合超

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

  • reply Baidu identifies browsers with a bunch of solutions
    胤彬- author 2018-10-31 15:50:04
胤彬-
<?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浏览器!';
 }


Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template