<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>ContrĂ´le GPIO</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body>
<form action="script.php" method="post">
<input type="submit" name="executer" value="ON" class="button" id="ON">
<input type="submit" name="executer" value="OFF" class="button" id="OFF">
</form>
</body>
</html>
html, body
{
margin: 0;
}
.button
{
border: none;
color: white;
text-align: center;
font-size: 10em;
padding: 25px 25px;
cursor: pointer;
width: 100%;
height: 50vh;
}
#ON
{
background-color: green;
}
#OFF
{
background-color: red;
}
<?php
system("gpio -g mode 17 out");
if($_POST['executer'] == 'ON')
{
system("gpio -g write 17 1");
}
else
{
system("gpio -g write 17 0");
}
header('Location: index.php');
?>