Hi All,
I’m having a first look at modx, until now I’ve been using wordpress and so far... modx looks like a MUCH better option for me.
Rightly or wrongly, I am in the habit of detecting the users browser in php via $_SERVER[’HTTP_USER_AGENT’] and subsequently sending browser specific css to the user, to ensure that my page looks the same in ie and non-ie browsers. I know this method doesn’t suit everyone, as it means you need two different sets of css - I like it, because it avoids ugly html conditional statements, and having to make one style sheet work in all browsers.
So.. I tried using a snippet to detect the browser, and return a specific chunk based on the user browser.
The problem is that array reference ($_SERVER[’HTTP_USER_AGENT’]) always returns the same string, regardless of which browser I access the modx page with:
Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/533.2 (KHTML, like Gecko) Chrome/5.0.342.9 Safari/533.2
so is there any way I can get the correct browser with a php snippet ?
thanks in advance
edit.. just noticed that the alternative $modx->getUserData(); is the same.. always returns the same info, regardless of which browser I use.