Sometimes in case of a bug in our code, we usually ask the end user to provide the browser configuration and OS configuration to isolate the issue. How can we get this information in开发者_如何学编程 case of a problem while the end users are accessing a web application.
Normally this information will be on the user-agent
header. See some info here.
However, this can be spoofed so should not be treated as gospel truth, nor do all browsers respect the fields and identify themselves properly.
Having said that, most people would not spoof it and the major browsers are reliable. So it can used as a general identifier for OS and browser.
You did not detail what configuration information you need, so this is of course only the basics.
You can get it with a PHP Function get_browser. You can also get it with a JavaScript Code.
精彩评论