哪个最适合浏览器检测:PHP 或 Javascript?
我想做的很简单:在登录过程中,如果系统检测到其他人使用相同的凭据签名,则通知用户当前登录的 IP 地址和浏览器。这就是为什么要使用 PHP 或 Javascript 将浏览器名称记录到数据库中登录期间。您知道用于此目的的任何好的脚本吗?
请给出链接或邮政编码。
What I want to do is simple: during signin process, if system detects that someone else signed with same credentials, to notify user about ip addresses and browsers that currently signed in. That's why want to use PHP or Javascript to record browser name into database during signin. Do you know any good script for this purpose?
Please give link or post code.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Java脚本最适合浏览器检测,因为在php中,有关浏览器的可用信息来自http用户代理标头,因为这是可以定制的,我们无法确定浏览器。但如果我们使用 javascript,我们会得到正确的结果。你可以使用jquery内置函数来检查浏览器及其版本。
示例:显示浏览器信息。
检查文档
http://api.jquery.com/jQuery.browser/
Java script is best for browser detection , because in php the information available about browsers come from the http user agent header, as this can be customized we cannot make sure about the browser. But if we use javascript we get the correct result. U can use the jquery built in function to check the browser and its version .
Example: Show the browser info.
Check the documentation
http://api.jquery.com/jQuery.browser/