This repository has been archived by the owner on Feb 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchangepass.php
105 lines (92 loc) · 4.37 KB
/
changepass.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?php
session_start();
if (isset($_SESSION['email'])) {
$pageTitle = 'Change Password';
include 'header.php';
$email = $_SESSION['email'];
$role = $_SESSION['role'];
try {
$sqlquery = "SELECT * FROM users where email='$email'";
try {
$returnval = $dbcon->query($sqlquery); ///PDO Statement
$userinfo = $returnval->fetchAll();
foreach ($userinfo as $userdata);
?>
<!-- Main layout -->
<main>
<br><br><br>
<div class="container-fluid">
<section class="section">
<div class="row">
<!-- Second column -->
<div class="col-md-6 mb-4 mx-auto">
<!-- Card -->
<div class="card card-cascade narrower wow rollIn">
<!-- Card image -->
<div class="view view-cascade gradient-card-header mdb-color lighten-3">
<h5 class="mb-0 font-weight-bold">Change Password</h5>
</div>
<!-- Card image -->
<!-- Card content -->
<div class="card-body card-body-cascade text-center">
<!-- Edit Form -->
<form method="POST" action="updatepass.php">
<!-- row -->
<div class="row">
<!-- First column -->
<div class="col-md-12">
<div class="md-form mb-0">
<input type="text" id="oldpass" class="form-control form-control-lg required validate">
<label for="oldpass">Old Password</label>
</div>
</div>
<!-- Second column -->
</div>
<div class="row">
<div class="col-md-12">
<div class="md-form mb-0">
<input type="text" id="newpass" class="form-control form-control-lg required validate">
<label for="newpass">New Password</label>
</div>
</div>
</div>
<!-- row -->
<!-- Fourth row -->
<div class="row">
<div class="col-md-12 text-center my-4">
<input type="submit" value="Update Password" class="btn btn-info btn-rounded">
</div>
</div>
<!-- Fourth row -->
</form>
<!-- Edit Form -->
</div>
<!-- Card content -->
</div>
<!-- Card -->
</div>
<!-- Second column -->
</div>
</section>
</div>
</main>
<!-- Main layout -->
<?php include 'footer.php';
} catch (PDOException $ex) {
?>
<p class="grey-text mt-3">Data read error ...</p>
<?php
}
} catch (PDOException $ex) {
?>
<p class="grey-text mt-3">Data read error ... ...</p>
<?php
}
} else {
?>
<script>
window.location.assign('login');
</script>
<?php
}
?>