forked from chiragmaniar/php_website
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path4_delete.php
More file actions
48 lines (32 loc) · 1.02 KB
/
4_delete.php
File metadata and controls
48 lines (32 loc) · 1.02 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
<?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");
//include custom functions files
//include_once("includes/functions.php");
//echo "flag : ".$_GET['flag']."<br>";
$flag = $_COOKIE["flag"];
if(isset($_POST['id'])){
$_SESSION['id'] = $_POST['id'];
}
?>
<SCRIPT LANGUAGE="JavaScript" type="text/javascript">
var r = confirm("Do you want to delete ?");
if (r == true) {
var flag = 1;
} else {
var flag = 2;
}
document.cookie = "flag="+flag;
//Uncomment according to your folder location
//window.location.href = "http://localhost/project/audit/extc/41_delete.php?flag=" + flag;
window.location.href = "http://localhost/extc/41_delete.php?flag=" + flag;
//window.location.href = "http://localhost/extc1/PHP_intern/42_delete.php?flag=" + flag;
</script>