Created
July 29, 2017 20:24
-
-
Save tombrad/7ebebc21919a81ba1deca5143eba6573 to your computer and use it in GitHub Desktop.
Página PHP para llamar a programas en Python (Autor Diego Torres)
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> | |
<head> | |
<?php | |
if (isset($_POST['LedON'])) | |
{ | |
exec('sudo python /var/www/html/raspduino/enciendeled.py'); | |
} | |
if (isset($_POST['LedOFF'])) | |
{ | |
exec('sudo python /var/www/html/raspduino/apagaled.py'); | |
} | |
?> | |
<title>Led Arduino</title> | |
</head> | |
<body> | |
<form method="post"> | |
<table | |
style="width: 75%; text-align: left; margin-left: auto; margin-right: auto;" | |
border="0" cellpadding="2" cellspacing="2"> | |
<tbody> | |
<tr> | |
<td style="text-align: center;">Turn LED on</td> | |
<td style="text-align: center;">Turn LED off</td> | |
</tr> | |
<tr> | |
<td style="text-align: center;"><button name="LedON">Led On</button></td> | |
<td style="text-align: center;"><button name="LedOFF">Led Off</button></td> | |
</tr> | |
</tbody> | |
</table> | |
</form> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment