Created
June 11, 2015 13:59
-
-
Save michaelsarduino/96c6c5ba85b609fe5856 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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