-
Notifications
You must be signed in to change notification settings - Fork 0
/
DELETE2.php
83 lines (58 loc) · 1.33 KB
/
DELETE2.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
<html>
<head>
<title>SELECT</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="LOGIN1.css"> -!>
</head>
<body>
<div id="body">
<?php
$SID = $_POST['SID'];
if ( !empty($SID) )
{
$servername = "localhost";
$username = "root";
$dbname ="sugan_SF";
// Create connection
$conn = new mysqli($servername, $username,"",$dbname);
// Check connection
if ($conn->connect_error)
{
die("Connection failed: " . $conn->connect_error);
}
else
{
$SELECT1 = "SELECT * FROM MAINTENANCE WHERE SID=$SID";
$RSLT1 = mysqli_query($conn, $SELECT1);
if (mysqli_num_rows($RSLT1) == 0 )
{
echo("<script type=\"text/javascript\">
window.alert('SID does not match any records!!!');
window.location.href='WELCOME2.html';
</script>");
}
else
{
$DELETE= "DELETE FROM `MAINTENANCE` WHERE `SID`=$SID" ;
$RESULT = mysqli_query($conn, $DELETE);
echo("<script type=\"text/javascript\">
window.alert('Record has been successfully removed');
window.location.href='WELCOME2.html';
</script>");
/*echo file_get_contents("WELCOME2.html");*/
}
$conn->close();
}
}
else
{
echo("<script type=\"text/javascript\">
window.alert('Enter SID!!');
window.location.href='WELCOME2.html';
</script>");
die();
}
?>
</div>
</body>
</html>