-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex2.php
170 lines (166 loc) · 6.36 KB
/
index2.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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<?php
$db = new mysqli('localhost', 'root', '', 'mostlikers');
session_start();
$check=@$_SESSION['login_username'];
if(isset($check))
{
header("Location:profile.php");
}
?>
<html>
<head>
<title>Forget password recovery using Ajax, php and mysqli | Mostlikers </title>
<link href='http://www.mostlikers.com/favicon.ico' rel='icon' type='image/x-icon'/>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.13.1/jquery.validate.min.js"></script>
<style type="text/css">
.error{
margin-top: 6px;
margin-bottom: 0;
color: #fff;
background-color: #D65C4F;
display: table;
padding: 5px 8px;
font-size: 11px;
font-weight: 600;
line-height: 14px;
}
</style>
</head>
<body>
<div class="modal-dialog">
<h2>Forget password recovery using Ajax, php and mysqli</h2>
<div>Demo <a href="http://www.mostlikers.com/2015/07/forget-password-recovery-using-ajax-php.html">Tutorial Link</a>
- mostlikers
<a href="http://www.mostlikers.com">mostlikers.com</a><br><br></div>
<div class="modal-content col-md-8">
<div class="modal-header">
<h4 class="modal-title"><i class="icon-paragraph-justify2"></i> User Login</h4>
</div>
<form method="post" autocomplete="off" id="login_form">
<div class="modal-body with-padding">
<div class="form-group">
<div class="row">
<div class="col-sm-10">
<label>Username *</label>
<input type="text" id="username" name="username" class="form-control required">
</div>
</div>
</div>
<div class="form-group">
<div class="row">
<div class="col-sm-10">
<label>Password *</label>
<input type="password" id="password" name="password" class="form-control required" value="">
</div>
</div>
</div>
<div class="form-group">
<p class="pull-right"><a href="#" data-toggle="modal" data-target=".resetpassword" data-dismiss="modal">
Forgot Password? </a>
</p>
</div>
</div>
<div class="error" id="logerror"></div>
<!-- end Add popup -->
<div class="modal-footer">
<input type="hidden" name="id" value="" id="id">
<button type="submit" id="btn-login" class="btn btn-primary">Submit</button>
</div>
</form>
</div>
</div>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- demo ads -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:50px"
data-ad-client="ca-pub-9665679251236729"
data-ad-slot="6794107020"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<!-- Modal for Reset password Starts Here -->
<div class="modal fade resetpassword" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal_dialog">
<div class="modal-content modal_content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">X</button>
<h4 class="modal-title">Forgot Your password ?</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" action="#" id="form_reset_pwd">
<fieldset>
<p>Enter your Email Address here to receive a linkdd to change password.</p>
<div class="form-group">
<label class="col-sm-3 control-label">Email :</label>
<div class="col-sm-9">
<input type="text" class="form-control required email" name="email" placeholder="Email"/>
</div>
</div>
<div id="error_result"></div>
<div class="form-group">
<div class="col-md-7 col-md-offset-5">
<button type="button" class="btn btn-primary forgot_password">Send Email</button>
</div>
</div>
</fieldset>
</form>
</div>
</div>
</div>
</div>
<!-- Modal for Reset password Ends Here -->
</body>
</html>
<script>
$(document).ready(function(){
$('#login_form').validate();
$(document).on('click','#btn-login',function(){
var url = "login.php";
if($('#login_form').valid()){
$('#logerror').html('<img src="ajax.gif" align="absmiddle"> Please wait...');
$.ajax({
type: "POST",
url: url,
data: $("#login_form").serialize(), // serializes the form's elements.
success: function(data) {
if(data==1) {
window.location.href = "profile.php";
}
else {
$('#logerror').html('The email or password you entered is incorrect.');
$('#logerror').addClass("error");
}
}
});
}
return false;
});
$(document).on('click','.forgot_password',function(){
var url = "reset_password.php";
if($('#form_reset_pwd').valid()){
$('#error_result').html('<img src="ajax.gif" align="absmiddle"> Please wait...');
$.ajax({
type: "POST",
url: url,
data: $("#form_reset_pwd").serialize(), // serializes the form's elements.
success: function(data) {
if(data==1)
{
$('#error_result').html('Check your email');
$('#error_result').addClass("green");
}
else
{
$('#error_result').html('Invalid email id. Please check your email id.');
$('#error_result').addClass("red");
}
}
});
}
return false;
});
});
</script>