我刚开始使用html和php。我写了这段代码,以眨眼一个覆盆子pi,但它不起作用。我已经更改了所有文件的权限。
<!DOCTYPE html>
<html>
<body>
<button type="button")"><a href="serverled.php?GO=INT">LED INIT</a></button>
<button type="button")"><a href="serverled.php?GO=ON">LED ON</a></button>
<button type="button")"><a href="serverled.php?GO=OFF">LED OFF</a></button>
</body>
</html>
<?php
session_start();
$action =$_GET['GO'];
switch($action)
{
case "INT":
shell_excec('sudo /bin/bash /var/www/ledinit.sh');
break;
case "ON":
shell_exec('sudo /bin/bash /var/www/ledon.sh');
break;
case "OFF":
shell_exec('sudo /bin/bash /var/www/ledoff.sh');
break;
}