General help

IE9 causing issues - want browser compatibility check

Picture of Morgan Walker
IE9 causing issues - want browser compatibility check


We'd like to implement some sort of browser checker on our site.  We've reached out to our Moodle hosting provider, Lambda, and they said they don't have anything that can help us.  I've seen other Moodle users whom have implemented this successfully, e.g.:


I read this post, which seem related -  That was an old post and it pointed me to, a browser compatibility block, which I don't have.  So, my question, what are other user's solutions to implementing a browser compatibility check on their moodle site?  What is the best way to implement this?



Average of ratings: -
Picture of Jez H
Re: IE9 causing issues - want browser compatibility check
Particularly helpful MoodlersPlugin developers

We dont have a browser check like that, In the past we displayed messages to users of old IE versions in our theme header suggesting they use Chrome instead. We went for Chrome as users can install it without admin rights on the pc, it insalls under the user settings.

To detect the browser in PHP you can use:

$browser = $_SERVER['HTTP_USER_AGENT'];

You can build an array of problematic browser strings:

$rubbish = array('ie 6 string', 'ie 7 string', 'ie 8 string', 'ie 9 string');

then check whether the browser is in the bad list:

if (in_array($browser, $rubbish)) {

    echo "update your browser";


To get that working you would need the correct strings for the offending browsers.

Rather than echo we broke out of PHP and rendered a DIV at the top of the page with a more meaningful message and a link to a help page showing them how to install Google Chrome.

Not particularly elegant but it solved the problem, and you can do easily it in the theme without messing with core moodle code.

We moved most of our editing teachers off old versions of IE this way.

As for the other checks, I don't think they are required. If you open flash / Java your browser will tell you, and I would not advocate users simply "turning popups on". If your cookies don't work you cannot log into Moodle at all.

I know that did not answer your question as such, but I hope it is never the less of some use to you, if you just want to get around your IE9 issues this should suffice smile

Average of ratings: -