-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdelete.php
More file actions
42 lines (33 loc) · 1.01 KB
/
Copy pathdelete.php
File metadata and controls
42 lines (33 loc) · 1.01 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>delete</title>
<link rel="stylesheet" href="style2.css"/>
</head>
<body>
<?php
require('db.php');
// When form submitted, insert values into the database.
if(isset($_POST["submit"])) {
$code = $_POST['code'];
$query = "DELETE FROM `product` WHERE code='$code'";
$result = mysqli_query($con, $query);
if ($result)
{
echo '<script>alert("Product deleted successfully")</script>';
} else {
echo '<script>alert("something wrong !! try once")</script>';
}
} else {
?>
<form class="form" action="" method="post" enctype="multipart/form-data">
<h1 class="login-title">DELETE PRODUCT</h1>
<input type="text" class="login-input" name="code" placeholder="code" required />
<input type="submit" name="submit" value="DELETE" class="login-button">
</form>
<?php
}
?>
</body>
</html>