-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdelete.php
87 lines (83 loc) · 1.47 KB
/
delete.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<!DOCTYPE html>
<html>
<head>
<title>Delete Entry</title>
<link rel="stylesheet" type="text/css" href="css/delete.css">
</head>
<body><br><br>
<table align="center">
<form action="#" method="POST">
<tr>
<font color="#B739FE"><h1>ENTER ROLL NUMBER</h1></font>
!!enter details with care may cause in loss of data!!<br><br><br>
</tr>
<tr>
<td><input class="input-box" type="text" style="height: 30px" name="std-rlno"></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr><tr>
<td></td>
</tr>
<tr>
<td>
<button class="button" type="Submit" name="Submit" style="vertical-align:middle" value="DELETE">
<span>DELETE</span>
</button>
</td>
</tr>
</form>
</table>
</body>
</html>
<?php
if (isset($_POST['Submit'])) {
$con=mysqli_connect('localhost','root','','rms');
if (!$con) {
die("Connection failed");
}
else{
$rlno = $_POST['std-rlno'];
}
$sql = "DELETE FROM result WHERE roll = '$rlno'" ;
$chk = mysqli_query($con , $sql);
if(empty($rlno)){
echo "Please Provide Roll Number";
}else{
if($chk)
echo "<center>DATA DELETED</center>";
else
echo " <center>DELETION FAILED</center>";
}
}
?>