Advertisement
Guest User

Untitled

a guest
Jan 3rd, 2014
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.48 KB | None | 0 0
  1. <?php
  2. error_reporting(E_ALL);
  3. error_reporting(-1);
  4.  
  5.   /* GPIO 17 = BLUE
  6.      GPIO  4 = GREEN
  7.      GPIO 22 = RED */
  8.  
  9. if(isset($_POST["redcolor"])) {
  10.     $rot = $_POST["redcolor"];  
  11. } else {
  12.     $rot = 0;  
  13. }
  14. if(isset($_POST["blucolor"])) {
  15.     $blau = $_POST["blucolor"];  
  16. } else {
  17.     $blau = 0;  
  18. }
  19. if(isset($_POST["grecolor"])) {
  20.     $gruen = $_POST["grecolor"];  
  21. } else {
  22.     $gruen = 0;  
  23. }
  24. $give = fsockopen("quasar.unixbox.tk", 45450, $errno, $errstr, 50);
  25. if(!$give) {
  26.     echo "$errstr ($errno)<br />\n";
  27.   } else {
  28.     fwrite($give, $rot);
  29.     fwrite($give, $gruen);
  30.     fwrite($give, $blau);
  31.     fclose($give);
  32. }
  33. ?>
  34.  
  35. <!DOCTYPE html>
  36. <html>
  37.  
  38. <head>
  39. <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
  40. <title>Quasar</title>
  41. <link rel="stylesheet" type="text/css" href="styles.css">
  42. </head>
  43. <body>  
  44.  
  45.   <div id="banner">
  46.     <h4>The Quasar Laboratory</h4>
  47.   </div>
  48.  
  49.   <div id="under_banner_right">
  50.       <p>In Farbe und Bunt</p>
  51.   </div>
  52.  
  53.  
  54.   <div id="main_field">
  55.      <img src="http://myhead.unixbox.tk:8081">
  56.   </div>
  57.  
  58.   <div id="formular">
  59.      <form method="post">
  60.        <p>
  61.        Blue&nbsp;&nbsp; <input type="radio" name="redcolor" value="1">   On  <br>
  62.        Green <input type="radio" name="blucolor" value="1">  On  <br>
  63.        Red &nbsp;&nbsp;&nbsp;<input type="radio" name="grecolor" value="1"> On <br>
  64.        </p>
  65.        <Input type="submit" value="Go">  
  66.      </form>
  67.   </div>
  68.  
  69. </body>
  70. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement