-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path41_delete.php
More file actions
53 lines (41 loc) · 954 Bytes
/
41_delete.php
File metadata and controls
53 lines (41 loc) · 954 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
echo "flag : ".$_GET['flag']."<br>";
?>
<?php
ob_start();
session_start();
//check if user has logged in or not
if(!isset($_SESSION['loggedInUser'])){
//send the iser to login page
header("location:index.php");
}
//connect ot database
include_once("includes/connection.php");
include_once("includes/functions.php");
$flag = $_GET['flag'];
$id = $_SESSION['id'];
if($flag == 1)
{
$sql = "delete from faculty WHERE P_ID = $id";
if ($conn->query($sql) === TRUE) {
if ($_SESSION['username'] == 'hodextc@somaiya.edu')
{
header("location:2_dashboard_hod.php?alert=delete");
}
else
header("location:2_dashboard.php?alert=delete");
}
else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
}
else if($flag == 2)
{
if ($_SESSION['username'] == 'hodextc@somaiya.edu')
{
header("location:2_dashboard_hod.php");
}
else
header("location:2_dashboard.php");
}
?>