Tutorial :Why does ie8's user agent return 'opera'?



Question:

My code at: http://www.mgxvideo.com/mgxcopy-dev/get_browser.php, returns Opera when I run IE8. My source is:

<?php  $browser = get_browser(null, true);  echo $browser['browser'];  ?>  


Solution:1

It doesn't. The get_browser() function is making educated (but ill-informed) guesses about which browser the user-agent is running. Your browser capabilities file is likely outdated, probably because it was made before IE8 was released. Update it here.

The real IE8 user-agent string looks something like this:

Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)  


Solution:2

You should use a lower-level tool, like a packet trace or server logging or a header dump to see what is being sent.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »