-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdelete.php
More file actions
55 lines (41 loc) · 1.07 KB
/
Copy pathdelete.php
File metadata and controls
55 lines (41 loc) · 1.07 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
<?php
require_once 'include/DB_Functions.php';
$db = new DB_Functions();
$con = $db->conn;
$response = array();
if (isset($_POST['pnum'])) {
$pnum = $_POST['pnum'];
$sql = "delete from products where products_num = '$pnum'";
$result = mysqli_query($con, $sql);
if ($result) {
// user stored successfully
$response["error"] = FALSE;
echo json_encode($response);
} else {
// user failed to store
$response["error"] = TRUE;
$response["error_msg"] = "삭제가 안되었어요.";
echo json_encode($response);
}
//}
} else {
$response["error"] = TRUE;
$response["error_msg"] = "오류가 발생했어요";
echo json_encode($response);
}
?>
<?php
$android = strpos($_SERVER['HTTP_USER_AGENT'], "Android");
if (!$android){
?>
<html>
<body>
<form action="<?php $_PHP_SELF ?>" method="POST">
pnum: <input type = "products_num" name = "products_num" />
<input type = "submit" />
</form>
</body>
</html>
<?php
}
?>