-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathremoverobot.php
54 lines (42 loc) · 1.18 KB
/
removerobot.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
48
49
50
51
52
53
54
<?php
include 'password.php';
if(isset($_POST['submit'])) {
$err = FALSE;
$message = '';
$target_path = '';
$servername = 'localhost';
$username = 'www';
$dbname = 'robotics';
$conn = new mysqli($servername, $username, $password, $dbname);
$number = mysqli_real_escape_string($conn, $_POST['number']);
if (!$number) {
$err = TRUE;
}
if ($conn->connect_error) {
die('Connection failed: ' . $conn->connect_error);
$err = TRUE;
}
$sql = "DELETE FROM pit_scout WHERE (number='$number') LIMIT 1";
if ($err || $conn->query($sql) === FALSE) {
echo 'Error' . $sql . $conn->error;
}
$conn->close();
}
?>
<!DOCTYPE html>
<head>
<link rel="stylesheet" href="css/form.css">
</head>
</body>
<div class="container">
<form id="contact" action="" method="post" enctype="multipart/form-data">
<h3>Robot Removal Form</h3>
<feildset>
<input placeholder="Team Number" name="number" type="number" min="0" tabindex="2" required>
</fieldset>
<fieldset>
<button name="submit" type="submit" id="contact-delete" data-delete="...Deleting">Delete</button>
</fieldset>
</form>
</div>
</body>