document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. <?php
  2. $onoroff = $_GET["state"];
  3. $textfile = "LEDstate.txt";
  4.  
  5. $fileLocation = "$textfile";
  6. $fh = fopen($fileLocation, \'w   \') or die("Algo Fallo"); // Esto abre el archivo .txt para escribir y remplaza su contenido
  7. $stringToWrite = "$onoroff"; // Escribe 1 o 0 dependiendo de la respuesta obtenida en index.html
  8. fwrite($fh, $stringToWrite); // Escribe sobre el archivo .txt
  9. fclose($fh);
  10.  
  11. header("Location: index.html"); // Regresa a (index.html)
  12. ?>
');