Hi, all.
I have a site that works wonderfully in FireFox, Opera and IE7 and higher.
Unfortunately, it looks like dren in IE6 (and, I assume, earlier)
My PHP prepares the page, then includes a 'print module' to give the user the page. This print module will import a template and then sub in the content in place of various placeholders in that page...
This is what I'm using for browser detection:
if (
(strpos ($_SERVER['HTTP_USER_AGENT'], "MSIE") !== false)
&&
(strpos ($_SERVER['HTTP_USER_AGENT'], "MSIE 7") === false)
)
{
// Internet Explorer <= 6
}
else
{
// Firefox, Opera, IE >= 7, etc.
}
What I want to do is 'future-proof' this so that IE8 will be given pages based on the 'standards' version of the template.
I found a get_browser() function, but it needs a browscap.ini which isn't available on my system. (Shared hosting.)
Also, I know that the user agent info can sometimes get stripped by proxies etc, and altered by users, which means that get_browser() isn't a 100% accurate method... Is there anything else that is more reliable?
Andrew.