-
Notifications
You must be signed in to change notification settings - Fork 19
/
forget_password.php
131 lines (117 loc) · 3.68 KB
/
forget_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
125
126
127
128
129
130
131
<html>
<head>
<title> Login Page</title>
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<link rel="stylesheet" href="site.css" />
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
</head>
<body>
<div>
<div class="parent-container">
<table width="100%" height="100%">
<tr>
<td align="center" valign="middle">
<div class="loginholder">
<table style="background-color:white;" class="table-condensed">
<tr>
<a href="./index.html"><img src="img/logo.png" alt="" width="250px"></a>
</tr>
<tr>
<td><b>Email Id:</b></td>
</tr>
<tr>
<td><input type="text" class="inputbox" id="email"/>
<br><p id="emailerror"></p></td>
</tr>
<tr>
<td><b>Old Password Id:</b></td>
</tr>
<tr>
<td><input type="password" class="inputbox" id="oldpassword"/>
<br><p id="oldpassworderror"></p></td>
</tr>
<tr>
<td><b>New Password:</b></td>
</tr>
<tr>
<td><input type="password" class="inputbox" id="newpassword" />
<br><p id="newpassworderror"></p> </td>
</tr>
<tr>
<td><b>Conform Password</b></td>
</tr>
<tr>
<td><input type="password" class="inputbox" id="cpassword"/>
<br><p id="cpassworderror"></p><div id="msg"></div></td>
</tr>
<tr>
<td align="center"><br />
<button class="btn-normal" id="login">Submit</button>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
$("#login").click(function(){
var email = $("#email").val().trim();
var oldpassword = $("#oldpassword").val().trim();
var newpassword = $("#newpassword").val().trim();
var cpassword = $("#cpassword").val().trim();
if( email == "" )
{
error = " <font color='red'>!Requrie Name.</font> ";
document.getElementById( "emailerror" ).innerHTML = error;
return false;
}
if( oldpassword == "")
{
error = " <font color='red'>!Requrie Email.</font> ";
document.getElementById( "oldpassworderror" ).innerHTML = error;
return false;
}
if( newpassword == "")
{
error = " <font color='red'>!Requrie Email.</font> ";
document.getElementById( "newpassworderror" ).innerHTML = error;
return false;
}
if( cpassword == "")
{
error = " <font color='red'>!Requrie Email.</font> ";
document.getElementById( "cpassworderror" ).innerHTML = error;
return false;
}
if( cpassword != newpassword)
{
error = " <font color='red'>!Password is not Match.</font> ";
document.getElementById( "cpassworderror" ).innerHTML = error;
return false;
}
$.ajax({
url:'forget.php',
type:'post',
data:{email:email,oldpassword:oldpassword,newpassword:newpassword},
success:function(response){
if(response == 1){
window.location = "login.php";
}else{
error = " <font color='red'>!Invalid UserId.</font> ";
document.getElementById( "msg" ).innerHTML = error;
return false;
}
$("#message").html(response);
}
});
});
});
</script>
</body>
</html>