-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchangepassword.php
More file actions
51 lines (47 loc) · 2.13 KB
/
changepassword.php
File metadata and controls
51 lines (47 loc) · 2.13 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
<?php
include "inc/header.php";
include "lib/User.php";
?>
<?php
if (isset($_GET['id'])) {
$userid = (int)$_GET['id'];
$sesid = Session::get("id");
if ($userid != $sesid) {
header("Location: index.php");
}
}
$user = new User();
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST["changepassword"])) {
$changePassword = $user->changePassword($userid, $_POST);
}
?>
<div class="row">
<div class="col-md-12">
<div class="panel-wrap">
<div class="pane-heading">
<h4>User Registration <span class="float-right"><a class="btn btn-primary" href="profile.php?id=<?php echo $userid; ?>">Back</a></span></h4>
</div>
<div class="panel-body">
<div style="max-width: 600px; margin: 0 auto; padding: 30px 0;">
<?php
if (isset($changePassword)) {
echo $changePassword;
}
?>
<form action="" method="POST">
<div class="form-group">
<label for="email">Old Password</label>
<input class="form-control" type="password" name="old_password" placeholder="Enter your Old Password">
</div>
<div class="form-group">
<label for="password">Password</label>
<input class="form-control" type="password" name="new_password" placeholder="Enter your New Password">
</div>
<button type="submit" name="changepassword" class="btn btn-info">Change Password</button>
</form>
</div>
</div>
</div>
</div>
</div>
<?php include "inc/footer.php" ?>