This question already has an answer here:
I'm having issues with IE 10, 9, 8 and below. (Tested with IE Tester). But my layout works on IE 11. I already have a page that recommends a user to upgrade their browser to IE 11 or use another browser. However, I don't have a code that redirects users to this recommendation page. I want to do it using PHP.
So, to sum it up:
What am I finding?: A PHP code that redirects users to a particular recommendation page.
</div>
If I did understood your question correctly,
Put this on the very top of your PHP file, this code will detect IE 10 and below, and redirect them to your recommendation page:
if(preg_match('/(?i)msie [1-9]/',$_SERVER['HTTP_USER_AGENT']))
{
header( 'Location: recommendation.php' ) ;
}
All user agents below 11 have MSIE
in them. Can just do a simple check for that
if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) {
// It's IE10 or earlier
}