Advertisement
Guest User

Untitled

a guest
May 24th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.80 KB | None | 0 0
  1. <html>
  2. <head>
  3.     <title>RoboCar Panel</title>
  4. <style>
  5. table {
  6.   font-family: arial, sans-serif;
  7.   border-collapse: collapse;
  8.   width: 100%;
  9. }
  10.  
  11. td, th {
  12.   border: 1px solid #dddddd;
  13.   text-align: left;
  14.   padding: 8px;
  15. }
  16.  
  17. tr:nth-child(even) {
  18.   background-color: #dddddd;
  19. }
  20. </style>
  21. </head>
  22. <style>
  23.         body {
  24.             background-image: url("robocar.png");
  25.             background-color: rgb(177, 180, 137);
  26.             background-size: 1150px 625px;
  27.             background-repeat:no-repeat;
  28.             background-position: center bottom;
  29.  
  30.         }
  31.        
  32.     </style>
  33.  
  34.         <body>
  35.         <h2><center>RoboCar Remote Control Panel</center></h2>
  36.         <form method="get" action="remotephp.php">
  37. <table>
  38. <tr>
  39. <td>
  40.                 <center><input type="submit" value="Left" name="Left"></center>
  41. </td>
  42. <td>
  43.                 <center><input type="submit" value="Right" name="Right"></center>
  44. </td>
  45. <td>
  46.                 <center><input type="submit" value="Forward" name="Forward"></center>
  47. </td>
  48. <td>
  49.                 <center><input type="submit" value="Backward" name="Backward"></center>
  50. </td>
  51. <td>
  52.         <center><input type="submit" value="Stop" name="Stop"></center>
  53. </td>
  54. <td>
  55.         <center><input type="submit" value="Sumo" name="Sumo"></center>
  56. </td>
  57. <td>
  58.         <center><input type="submit" value="LineFollowing" name="LineFollowing"></center>
  59. </td>
  60.  
  61.  
  62.         </form>
  63.  
  64.  
  65.  
  66.  
  67.         <?php
  68.         if(isset($_GET['Left'])){
  69.         system("cd /var/www/html");
  70.         system("sudo python3 Left.py");
  71.                
  72.                 echo "Turning left!";
  73.             }
  74.         else if(isset($_GET['Right'])){ // See comment above
  75.                 system("cd /var/www/html");
  76.         system("sudo python3 Right.py");
  77.  
  78.                 echo "Turning right!";
  79.             }
  80.         else if(isset($_GET['Forward'])){ // See comment above
  81.                 system("cd /var/www/html");
  82.         system("sudo python3 Forward.py");
  83.  
  84.  
  85.                 echo "Going forward!";
  86.             }
  87.             else if(isset($_GET['Backward'])){ // See comment above
  88.                 system("cd /var/www/html");
  89.         system("sudo python3 Backward.py");
  90.  
  91.  
  92.                 echo "Going backward!";
  93.             }
  94.     else if(isset($_GET['Stop'])){ // See comment above
  95.                 system("sudo killall python3");
  96.                 echo "Stopping!";
  97.             }
  98.     else if(isset($_GET['Sumo'])){ // See comment above
  99.                 system("cd /var/www/html");
  100.         system("sudo python3 sumo.py");
  101.  
  102.                 echo "Running SumoBattle mode!";
  103.             }
  104.     else if(isset($_GET['LineFollowing'])){ // See comment above
  105.                 system("cd /var/www/html");
  106.         system("sudo python3 linefollow.py");
  107.  
  108.                 echo "Running LineFollowing mode!";
  109.             }
  110.  
  111.  
  112.  
  113.                 ?>
  114.         </body>
  115.  
  116.  
  117. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement