-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdelete.php
More file actions
31 lines (23 loc) · 719 Bytes
/
delete.php
File metadata and controls
31 lines (23 loc) · 719 Bytes
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
<?php include 'header.php';
if(isset($_POST['deletebtn'])){
include 'config.php';
$stu_id = $_POST['sid'];
$sql = "DELETE FROM student WHERE sid = $stu_id";
$result = mysqli_query($conn, $sql) or die("Query Unsuccessful.");
header("Location: http://localhost/crud_html/index.php");
mysqli_close($conn);
}
?>
<div id="main-content">
<h2>Delete Record</h2>
<form class="post-form" action="<?php $_SERVER['PHP_SELF']; ?>" method="post">
<div class="form-group">
<label>Id</label>
<input type="text" name="sid" />
</div>
<input class="submit" type="submit" name="deletebtn" value="Delete" />
</form>
</div>
</div>
</body>
</html>