<?php include "template.php"; login_auth(); $state = $_POST['state']; $led_number = $_POST['led_number']; if ($state === '0') { ssh2_cmd('sh /var/www/script/ledoff.sh ' . $led_number); } else { ssh2_cmd('sh /var/www/script/ledon.sh ' . $led_number); }
<?php include "template.php"; login_auth(); $state = $_POST['state']; $gpio_number = $_POST['gpio_number']; if ($state === '0') { ssh2_cmd('sh /var/www/script/gpiooff.sh ' . $gpio_number); } else { ssh2_cmd('sh /var/www/script/gpioon.sh ' . $gpio_number); }
function gpioInit() { ssh2_cmd("sh /var/www/script/gpioInit.sh"); }