This repository has been archived by the owner on Aug 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathchange-password.php
124 lines (105 loc) · 4.01 KB
/
change-password.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<?php
session_start();
error_reporting(0);
include_once('includes/config.php');
include_once 'includes/functions.php';
if(strlen($_SESSION['userlogin'])==0){
header('location:login.php');
}elseif (isset($_POST['change_pass'])) {
$currentpassword=htmlspecialchars($_POST['password']);
$npass=htmlspecialchars($_POST['newpassword']);
$username=$_SESSION['userlogin'];
$sql ="SELECT Password FROM users WHERE UserName=:uname";
$query= $dbh -> prepare($sql);
$query-> bindParam(':uname', $username, PDO::PARAM_STR);
$query-> execute();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">
<meta name="description" content="Smarthr - Bootstrap Admin Template">
<meta name="keywords" content="admin, estimates, bootstrap, business, corporate, creative, management, minimal, modern, accounts, invoice, html5, responsive, CRM, Projects">
<meta name="author" content="Dreamguys - Bootstrap Admin Template">
<meta name="robots" content="noindex, nofollow">
<title>Change Password - HRMS admin template</title>
<!-- Favicon -->
<link rel="shortcut icon" type="image/x-icon" href="assets/img/favicon.png">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<!-- Fontawesome CSS -->
<link rel="stylesheet" href="assets/css/font-awesome.min.css">
<!-- Lineawesome CSS -->
<link rel="stylesheet" href="assets/css/line-awesome.min.css">
<!-- Main CSS -->
<link rel="stylesheet" href="assets/css/style.css">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="assets/js/html5shiv.min.js"></script>
<script src="assets/js/respond.min.js"></script>
<![endif]-->
</head>
<body>
<!-- Main Wrapper -->
<div class="main-wrapper">
<!-- Header -->
<?php include_once("includes/header.php");?>
<!-- /Header -->
<!-- Sidebar -->
<?php include_once("includes/setting_sidebar.php");?>
<!-- /Sidebar -->
<!-- Page Wrapper -->
<div class="page-wrapper">
<div class="content container-fluid">
<div class="row">
<div class="col-md-6 offset-md-3">
<!-- Page Header -->
<div class="page-header">
<div class="row">
<div class="col-sm-12">
<h3 class="page-title">Change Password</h3>
</div>
</div>
</div>
<!-- /Page Header -->
<?php if($npass == $currentpassword){echo "they matched";}else{echo "they did not matched";} ?>
<form method="POST" enctype="multipart/form-data">
<div class="form-group">
<label>Current password</label>
<input required name="password" type="password" class="form-control">
</div>
<div class="form-group">
<label>New password</label>
<input required name="newpassword" type="password" class="form-control">
</div>
<div class="form-group">
<label>Confirm password</label>
<input required name="confirmpassword" type="password" class="form-control">
</div>
<div class="submit-section">
<button type="submit" name="change_pass" class="btn btn-primary submit-btn">Update Password</button>
</div>
</form>
</div>
</div>
</div>
<!-- /Page Content -->
</div>
<!-- /Page Wrapper -->
</div>
<!-- /Main Wrapper -->
<!-- jQuery -->
<script src="assets/js/jquery-3.2.1.min.js"></script>
<!-- Bootstrap Core JS -->
<script src="assets/js/popper.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<!-- Slimscroll JS -->
<script src="assets/js/jquery.slimscroll.min.js"></script>
<!-- Select2 JS -->
<script src="assets/js/select2.min.js"></script>
<!-- Custom JS -->
<script src="assets/js/app.js"></script>
</body>
</html>