-
Notifications
You must be signed in to change notification settings - Fork 0
/
admincategorydelete.php
54 lines (46 loc) · 1.09 KB
/
admincategorydelete.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
<?php
// connect to the database
include('config.php');
//Starts Session
session_start();
ob_start();
//If not logged in as admin
if (!isset($_SESSION['username'])) {
$_SESSION['msg'] = "You must log in first";
header('location: login_a.php');
}
//Logout
if (isset($_GET['logout'])) {
session_destroy();
unset($_SESSION['username']);
header("location: login.php");
}
$deletep = $_GET['deletep'];
// get the records from the database
if ($result = $link->query("DELETE FROM category WHERE id = '". $deletep ."'"))
{
echo '<script>alert("Kategori Dipadam")</script>';
}
// show an error if there is an issue with the database query
else
{
echo "Error: " . $mysqli->error;
}
// close database connection
$link->close();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Padam Kategori</title>
</head>
<body>
<script>
var sPageURL = window.location.href;
var url = document.location.href;
window.location = "admincategory.php";
</script>
</body>
</html>