如何在php中选择一个浏览器并在该浏览器上运行 [英] how can select a browser in php and run on that selected browser

查看:86
本文介绍了如何在php中选择一个浏览器并在该浏览器上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在php中选择一个浏览器并在该浏览器上运行

how can select a browser in php and run on that selected browser

推荐答案

这不是PHP所要做的它用于Web开发. PHP是一种服务器端技术.它与服务器计算机一侧的Web服务器一起使用,并将内容(通常是即时生成)传递到浏览器所在的客户端.在客户端-服务器范例中,服务器是纯粹的被动实体,它无法启动任何交互,只有客户端可以.

这样,即使PHP代码可以获取由浏览器本身报告的有关浏览器的信息,它也不能以任何方式影响浏览器的操作,除非通过来自浏览器的请求发送Web响应.
因此,当PHP脚本起作用时,浏览器已经在运行并且已经发送了请求.太晚了.

不,选择浏览器的整个想法根本没有任何意义.这件事完全由网站用户决定.所有PHP脚本可以做的就是产生这样的输出:"抱歉,我们不支持IE6.Microsoft和其他各方强烈建议不要使用此版本的Web浏览器.不要那么松懈,请使用一些体面的Web浏览器!".

注意:是的,或者,PHP可以在本地用作使用PHP脚本的运行时主机,因此它可以启动任何应用程序,包括任何特定的浏览器.但这与Web开发无关,并且与在所选浏览器上运行"不同. 您无法在特定的浏览器上运行PHP应用程序,因为它从未在任何浏览器上运行.

—SA
This is not what PHP does, if you use it for Web development. PHP is a server-side technology. It works with the Web server on the side of the server machine and delivers content (generally generated on the fly) to the client side, where the browser is. In client-server paradigm, the server is purely passive entity, it cannot initiate any interaction, only client side can.

In this way, even though PHP code can get information about the browser reported by the browser itself, it cannot affect browser operation in any way except sending the Web response by the request from the browser.
Consequently, when a PHP script comes into play, a browser is already running and has sent a request. Too late.

No, the whole idea of selecting browser makes no sense at all. This matter is completely at the discretion of the user of the Web site. All PHP script can do is produce output like this: "Sorry, we do not support IE6. Using this version of the Web browser is strongly discouraged by Microsoft and other parties. Don''t be such a looser, use some decent Web browser!".

Note: Yes, alternatively, PHP can be used locally as a run-time host for using PHP scripts and as such it can launch any application, including any specific browser. But this has nothing to do with Web development and is not the same as "run on that selected browser". You cannot run PHP application on specific browser because it never runs on any browser.

—SA


这篇关于如何在php中选择一个浏览器并在该浏览器上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆