my site uses browser detection on login, on login this detection is achieved using JavaScript and the verification script in PHP it works pretty good but on IE trouble begins, as the JavaScript navigator.userAgent returns

Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729; rv:11.0) like Gecko

And PHP only returns

Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko

What's the fix for this? If there is some. I could not find anything about this even on MS website. On Opera, FireFox and Chrome the scripts are working just fine...

有帮助吗?

解决方案

Since you're sniffing browser, perhaps use the get_browser() function... but you should not rely on user agents!

It's up to the browser to determine what to set as its user agent for HTTP_USER_AGENT.

Lastly, Starting with IE11, the user-agent string no longer includes the version token.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top