Advertisement
Guest User

Untitled

a guest
Nov 20th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.97 KB | None | 0 0
  1. # see the status of the component, and display the other button
  2. function displayButton($component, $status){
  3.         if ($status == O )
  4.         {
  5.                 echo '<form action="" method="post">';
  6.                 echo '<input type="hidden" name="ON" value="0"/><input type="submit" value="ON"/></form>';
  7.         }
  8.         else if ($status == 1 )
  9.         {
  10.                 echo '<form action="" method="post">';
  11.                 echo '<input type="hidden" name="OFF" value="1"/><input type="submit" value="OFF"/></form>';
  12.         }
  13.  
  14.         if (isset($_POST['OFF']))
  15.         {
  16.                 $command = "0";
  17.                 echo $command;
  18.                 exec("/home/debian/Desktop/EOS/Week44/I2CDriver $command $component",$output);
  19.         }
  20.         else if (isset($_POST['ON']))
  21.         {
  22.                 $command = "1";
  23.                 echo $command;
  24.                 exec("/home/debian/Desktop/EOS/Week44/I2CDriver $command $component",$output);
  25.         }
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement