-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdelete-list.php
More file actions
35 lines (24 loc) · 837 Bytes
/
delete-list.php
File metadata and controls
35 lines (24 loc) · 837 Bytes
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
<?php
include('config/constants.php');
if(isset($_GET['list_id'])){
$list_id = $_GET['list_id'];
$conn = mysqli_connect(LOCALHOST, DB_USERNAME, DB_PASSWORD) or die(mysqli_error());
$db_select = mysqli_select_db($conn, DB_NAME) or die(mysqli_error());
$sql = "DELETE FROM tbl_lists WHERE list_id=$list_id";
$res = mysqli_query($conn, $sql);
if($res==true)
{
$_SESSION['delete'] = "List Deleted Successfully";
header('location:manage-list.php');
}
else
{
$_SESSION['delete_fail'] = "Failed to Delete List.";
header('location:manage-list.php');
}
}
else
{
header('location:manage-list.php');
}
?>