forked from chiragmaniar/php_website
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path51_fdc_delete.php
More file actions
51 lines (34 loc) · 880 Bytes
/
51_fdc_delete.php
File metadata and controls
51 lines (34 loc) · 880 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
<?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 fdc WHERE FDC_ID = $id";
if ($conn->query($sql) === TRUE) {
if($_SESSION['username'] == 'hodextc@somaiya.edu')
{
header("location:5_fdc_dashboard_hod.php?alert=delete");
}
else
header("location:5_fdc_dashboard.php?alert=delete");
}
else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
}
else if($flag == 2)
header("location:5_fdc_dashboard.php");
?>