-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathforgotpassword.php
150 lines (127 loc) · 4.67 KB
/
forgotpassword.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<!DOCTYPE html>
<html lang="en">
<head>
<title>Forgot Password</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--===============================================================================================-->
<link rel="stylesheet" type="text/css" href="css/util.css">
<link rel="stylesheet" type="text/css" href="css/signup.css">
<!--===============================================================================================-->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script src='https://kit.fontawesome.com/a076d05399.js'></script>
<script src="https://smtpjs.com/v3/smtp.js"></script>
<link rel="icon" type="image/png" href="images/logoicon.ico"/>
<meta name="robots" content="noindex, follow">
<style>
.box {
background: white;
margin: auto;
width: 600px;
padding: 20px 50px;
border-radius: 10px;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
transition: all 0.3s cubic-bezier(.25,.8,.25,1);
}
.box:hover {
border-top-left-radius: 10px;
border-bottom-left-radius: 10px;
animation-name: example;
animation-duration: 0.25s;
border-left: 8px solid red;
box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
}
@keyframes example {
0% {border-left: 2px solid #ffffff;}
25% {border-left: 3px solid #ffe6e6;}
50% {border-left: 4px solid #ff8080;}
100% {border-left: 5px solid #ff0000;}
}
.error-text{
font-family: Poppins-Regular;
background: #ffcccb;
display :block;
border-radius: 5px;
line-height: 2.5;
text-align: center;
}
}
</style>
</head>
<body>
<div class="limiter">
<div class="container-signup100">
<div class="box">
<form class="signup100-form validate-form" method="post" enctype="multipart/form-data" autocomplete="off" id="form">
<span class="signup100-form-title p-b-70" style="font-family: Georgia, serif; font-weight: bold; font-size: 30px; text-align: center;padding-top: 40px;">
Change Password
</span>
<br>
<div class="error-text"></div>
<br>
<div class="name-details" style="display: flex">
<div class="wrap-input100 validate-input" data-validate = "Valid email is required: [email protected]" style="width:100%;">
<input class="input100" type="text" id="myText" name="email" placeholder="Email">
<span class="focus-input100"></span>
<span class="symbol-input100">
<i class="fa fa-envelope" aria-hidden="true"></i>
</span>
</div>
</div>
<div class="name-details" style="display: flex">
<div class="wrap-input100 validate-input" data-validate = "Password is required" style="width:100%;">
<input class="input100" type="password" name="pass" placeholder="New Password">
<span class="focus-input100"></span>
<span class="symbol-input100">
<i class="fa fa-lock" aria-hidden="true"></i>
</span>
</div>
</div>
<div class="name-details" style="display: flex">
<div class="wrap-input100 validate-input" data-validate = "Password is required" style="width:100%;">
<input class="input100" type="password" name="pass" placeholder="Confirm Password">
<span class="focus-input100"></span>
<span class="symbol-input100">
<i class="fa fa-lock" aria-hidden="true"></i>
</span>
</div>
</div>
<div class="container-signup100-form-btn">
<input type="submit" name="submit" value="NEXT" class="signup100-form-btn" id="btn">
</div>
<br>
</form>
</div>
</div>
</div>
<script type="text/javascript">
const form=document.querySelector("#form"),
continueBtn=document.querySelector("#btn"),
errorText= form.querySelector(".error-text");
form.onsubmit = (e)=>{
e.preventDefault();
}
continueBtn.onclick = ()=>{
let xhr = new XMLHttpRequest();
xhr.open("POST", "php/forgot.php", true);
xhr.onload = ()=>{
if(xhr.readyState === XMLHttpRequest.DONE){
if(xhr.status === 200){
let data = xhr.response;
console.log(data);
if(data === "success"){
location.href = "index.php";
alert("PASSWORD changed!!");
}else{
errorText.textContent = data;
errorText.style.height = "45px";
}
}
}
}
let formData = new FormData(form);
xhr.send(formData);
}
</script>
</body>
</html>