-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgaragedoor.php
47 lines (47 loc) · 1.31 KB
/
garagedoor.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
echo "<link rel='stylesheet' type='text/css' href='stylegarage.css' />";
if(!empty($_GET['north'])) {
echo exec('gpio mode 6 out');
echo exec('gpio write 6 0');
usleep(1000000);
echo exec('gpio write 6 1');
?>
<form action="testexec.php" method="get" >
<input type="hidden" name="north" value="run">
<input type="submit" value="Door North">
</form>
<form action="testexec.php" method="get">
<input type="hidden" name="south" value="run">
<input type="submit" value="Door South">
</form>
<?php
}
else if (!empty($_GET['south'])) {
echo exec('gpio mode 7 out');
echo exec('gpio write 7 0');
usleep(1000000);
echo exec('gpio write 7 1');
?>
<form action="testexec.php" method="get">
<input type="hidden" name="north" value="run">
<input type="submit" value="Door North">
</form>
<form action="testexec.php" method="get">
<input type="hidden" name="south" value="run">
<input type="submit" value="Door South">
</form>
<?php
}
else{
?>
<form action="testexec.php" method="get">
<input type="hidden" name="north" value="run">
<input type="submit" id="submit" value="Door North">
</form>
<form action="testexec.php" method="get">
<input type="hidden" name="south" value="run">
<input type="submit" id="submit" value="Door South">
</form>
<?php
}
?>