-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforgot-password.php
More file actions
85 lines (75 loc) · 2.56 KB
/
forgot-password.php
File metadata and controls
85 lines (75 loc) · 2.56 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
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
<?php
include 'functions/config.php';
if(isset($_POST['submit'])){
$email = $_POST['email'];
// echo $email;
$sql = "SELECT * FROM tbl_user WHERE user_email = ? ";
$query = $pdo->prepare($sql);
$query->bindParam(1, $email);
$query->execute();
$result = $query->fetch(PDO::FETCH_ASSOC);
if($result){
session_start();
$_SESSION['userID'] = $result['user_id'];
$_SESSION['userName'] = $result['username'];
header("location: recover-password.php");
} else{
echo "<div class='alert alert-warning'>Email Doesn't Match</div>";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>POS | Forgot Password</title>
<!-- Google Font: Source Sans Pro -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">
<!-- Font Awesome -->
<link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css">
<!-- icheck bootstrap -->
<link rel="stylesheet" href="plugins/icheck-bootstrap/icheck-bootstrap.min.css">
<!-- Theme style -->
<link rel="stylesheet" href="assets/css/adminlte.min.css">
</head>
<body class="hold-transition login-page">
<div class="login-box">
<div class="card card-outline card-primary">
<div class="card-header text-center">
<a href="index.php" class="h1"><b>Inventory</b>POS</a>
</div>
<div class="card-body">
<p class="login-box-msg">You forgot your password? Here you can easily retrieve a new password.</p>
<form action="<?php $_SERVER['PHP_SELF']?>" method="post">
<div class="input-group mb-3">
<input type="email" name="email" class="form-control" placeholder="Email" required>
<div class="input-group-append">
<div class="input-group-text">
<span class="fas fa-envelope"></span>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<button type="submit" name="submit" class="btn btn-primary btn-block">Request new password</button>
</div>
<!-- /.col -->
</div>
</form>
<p class="mt-3 mb-1">
<a href="index.php">Sign in</a>
</p>
</div>
<!-- /.login-card-body -->
</div>
</div>
<!-- /.login-box -->
<!-- jQuery -->
<script src="../../plugins/jquery/jquery.min.js"></script>
<!-- Bootstrap 4 -->
<script src="../../plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- AdminLTE App -->
<script src="../../dist/js/adminlte.min.js"></script>
</body>
</html>