-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeleteall.php
50 lines (46 loc) · 1.02 KB
/
deleteall.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
<!DOCTYPE HTML>
<html>
<head>
<style>
h2{
border-style: solid;
border-color: #000000;
text-align: center;
margin-top: 50px;
margin-bottom: 50px;
margin-right: 150px;
margin-left: 150px;
padding-top: 100px;
padding-right: 50px;
padding-bottom: 100px;
padding-left: 50px;
}
</style>
</head>
<body>
<?php
ob_start();
session_start();
if(!isset($_SESSION["username"])||!isset($_SESSION["password"])){
header('Refresh: 0; URL = http://localhost/project/login.php');
}
@require "out_menu.php";
require "connect.php";
// sql to delete a record
$sql = "DELETE FROM employee";
if ($conn->query($sql) === TRUE) {
echo "Record deleted successfully";
} else {
echo "Error deleting record: " . $conn->error;
}
$conn->close();
//header('Refresh: 2; URL = out_menu.php');
function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
?>
</body>
</html>