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?
. . . . . . . . . . . . . . . . . . . . . .
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
胤彬-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浏览器!'; }