-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontroll.php
More file actions
68 lines (37 loc) · 1.3 KB
/
Copy pathcontroll.php
File metadata and controls
68 lines (37 loc) · 1.3 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
$dbhost = "localhost";
$dbuser = "root";
$dbpass = "";
$db = "control";
$conn = mysqli_connect($dbhost, $dbuser, $dbpass,$db)
?>
<?php
if (isset($_POST['Forward'])) {
$sql= "INSERT INTO `control_panel` (`Forward`, `Left`, `Right`, `Stop`, `Backward`) VALUES ('Forward', 'non', 'non', '1', 'non')";
$result = $conn->query($sql);
}
?>
<?php
if (isset($_POST['Backward'])) {
$sql= "INSERT INTO `control_panel` (`Forward`, `Left`, `Right`, `Stop`, `Backward`) VALUES ('non', 'non', 'non', '1', 'Backward')";
$result = $conn->query($sql);
}
?>
<?php
if (isset($_POST['Left'])) {
$sql= "INSERT INTO `control_panel` (`Forward`, `Left`, `Right`, `Stop`, `Backward`) VALUES ('non', 'Left', 'non', '1', 'non')";
$result = $conn->query($sql);
}
?>
<?php
if (isset($_POST['Right'])) {
$sql= "INSERT INTO `control_panel` (`Forward`, `Left`, `Right`, `Stop`, `Backward`) VALUES ('non', 'non', 'Right', '1', 'non')";
$result = $conn->query($sql);
}
?>
<?php
if (isset($_POST['Stop'])) {
$sql= "INSERT INTO `control_panel` (`Forward`, `Left`, `Right`, `Stop`, `Backward`) VALUES ('non', 'non', 'non', '0', 'non')";
$result = $conn->query($sql);
}
?>