Click here to Skip to main content
15,887,947 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how can select a browser in php and run on that selected browser
Posted
Comments
Debojyoti Majumder 16-May-11 2:48am    
do you want to list all the browser available in the system??
Sergey Alexandrovich Kryukov 16-May-11 3:09am    
:-)

1 solution

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
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900