-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdelete.php
More file actions
52 lines (48 loc) · 1.18 KB
/
Copy pathdelete.php
File metadata and controls
52 lines (48 loc) · 1.18 KB
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
<?php
// This code vulnerable to Idor
// I will mitegate it later
session_start();
require_once 'connect.php';
if (!isset($_SESSION['user_id']))
{
header('Location: index.php');
exit();
}
if (isset($_GET['IDTask']))
{
$task_id = $_GET['IDTask'];
$Query7 = 'delete from task WHERE idtask = :a and idu = :b';
$statment7 = $conn->prepare($Query7);
$statment7->execute(array(
':a' => $task_id,
':b' => $_SESSION['user_id']
)
);
header('Location: show_tasks.php');
exit();
}
if (isset($_GET['IDTTask']))
{
$task_id = $_GET['IDTTask'];
$Query7 = 'delete from task WHERE idtask = :a ';
$statment7 = $conn->prepare($Query7);
$statment7->execute(array(
':a' => $task_id
)
);
header('Location: all_task.php');
exit();
}
// else if (isset($_GET['IDTask']) && $_SESSION["role"] == "admin")
// {
// $task_id = $_GET['IDTask'];
// $Query8 = 'delete from task where idtask = :a';
// $statment8 = $conn->prepare($Query8);
// $statment8->execute(array(
// ':task_id' => $task_id
// )
// );
// header('Location: admindashboard.php');
// exit();
// }
?>