-
Notifications
You must be signed in to change notification settings - Fork 0
/
delete.php
86 lines (76 loc) · 2.14 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
<<<<<<< HEAD
<?php
session_start();
if ($_SESSION["status"] != "start") {
header("Location: login.php");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<?php
$id = $_POST['id'];
$servername = "localhost";
$username = "root";
$password = "1212";
$database_name = "demo";
$conn = new mysqli($servername, $username, $password, $database_name);
if ($conn->connect_error){
die("Connection Failed");
}
$sql = "DELETE FROM student WHERE id='$id'";
if ($conn->query($sql) === TRUE) {
// sleep(0.5);
header("Location: home.php");
// echo '<script>alert("Successfully Inserted")</script>';;
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>
</body>
=======
<?php
session_start();
if ($_SESSION["status"] != "start") {
header("Location: login.php");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<?php
$id = $_POST['id'];
$servername = "localhost";
$username = "root";
$password = "1212";
$database_name = "demo";
$conn = new mysqli($servername, $username, $password, $database_name);
if ($conn->connect_error){
die("Connection Failed");
}
$sql = "DELETE FROM student WHERE id='$id'";
if ($conn->query($sql) === TRUE) {
// sleep(0.5);
header("Location: home.php");
// echo '<script>alert("Successfully Inserted")</script>';;
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>
</body>
>>>>>>> 7fb49b44ac3f78ec1fe897227182c38b32539231
</html>