Skip to content

Instantly share code, notes, and snippets.

@michaelsarduino
Created June 11, 2015 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelsarduino/96c6c5ba85b609fe5856 to your computer and use it in GitHub Desktop.
Save michaelsarduino/96c6c5ba85b609fe5856 to your computer and use it in GitHub Desktop.
<html>
<h1>Hier kannst du die LED des Arduino steuern.</h1>
<form action="arduino_webpage.php" method="POST">
<input type="radio" id="an" name="status" value="an" />an <br />
<input type="radio" id="aus" name="status" value="aus" />aus <br />
<input type="submit" value="schalten" />
</form>
<?php
if($_POST['status'] != "")
{
$status = $_POST['status'];
$handle = fopen('file.txt', "w");
if($status == "an")
{
$write = 1;
}
else {
$write = 0;
}
fwrite($handle, $write);
fclose($handle);
echo "Die LED wurde ";
echo $status;
echo " geschaltet!";
}
?>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment