我有一个HTML页面,并且有两个按钮,当我单击按钮时需要运行2个不同的“ sh”命令,使用PHP和Ajax如何实现呢?
You can ajax request to php page and use exec
<?php
// outputs the username that owns the running php/httpd process
// (on a system with the "whoami" executable in the path)
echo exec('whoami');
?>
<?php
$output = shell_exec('ls -lart');
echo "<pre>$output</pre>";
?>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.