开发者

Is it possible to detect usb devices using php?

开发者 https://www.devze.com 2023-02-06 12:48 出处:网络
Is it po开发者_JAVA技巧ssible to detect usb mouse,keyboard or flash drives when they are connected using php?Which side - server side or client side?

Is it po开发者_JAVA技巧ssible to detect usb mouse,keyboard or flash drives when they are connected using php?


Which side - server side or client side?

Server side: possible, although probably not a good idea. You would call OS specific functions or shell commands to access USB (e.g. shell_exec("lsusb -v"); ), and process the results.

Client side: No. PHP just works on server side.

Commandline PHP: same as Server side.

You are using the wrong tool for the job. Go back and use one more suited to the task.


This is not really a matter of PHP, but of the underlying operating system. If the operating system detects it and makes the information readable for the user that runs the PHP script, you can "detect" devices using PHP.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号