-
Notifications
You must be signed in to change notification settings - Fork 0
/
delete_user.php
54 lines (40 loc) · 1.33 KB
/
delete_user.php
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
54
<?php
include_once('database/connection.php');
include_once('database/users.php');
include_once('lock.php');
if($_SERVER["REQUEST_METHOD"] == "POST") {
if(isset($_POST['password'])) {
$params = array('db' => $db, 'username' => $_SESSION['myusername'], 'password' => $_POST['password']);
if(checkPassword($params)) {
deleteUser($params);
} else {
$errrors = array();
$errors[] = "Incorrect password.";
}
}
}
include_once('templates/header.php');
?>
<form role="form" method="POST" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
<div class="panel panel-primary">
<div class="panel-heading">
<div class="panel-title">
<a class="close" href="user.php">×</a>
<p>Are you sure you want to delete your account and all that is associated?<p/>
</div>
</div>
<div class="panel-body">
<div class="row">
<div class="col-lg-4">
<div class="input-group">
<input type="password" class="form-control" id="password" name="password" style="text-align:center" autocomplete="off" placeholder="Confirm your password..." />
<span class="input-group-btn">
<input type="submit" value="Confirm" name="submit" class="btn btn-success"/>
</span>
</div>
</div>
</div>
</div>
</div>
</form>
<?php include_once('templates/footer.php');