-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforgot_password.php
103 lines (91 loc) · 3.3 KB
/
forgot_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
<!DOCTYPE html>
<html>
<head>
<title>Forgetten Password</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="style/home_style2.css">
</head>
<style>
body{
overflow-x: hidden;
}
.main-content{
width: 50%;
height: 40%;
margin: 10px auto;
background-color: #fff;
border: 2px solid #e6e6e6;
padding: 40px 50px;
}
.header{
border: 0px solid #000;
margin-bottom: 5px;
}
.well{
background-color: #187FAB;
}
#signup{
width: 60%;
border-radius : 30px;
}
</style>
<body>
<div class="row">
<div class = "col-sm-12">
<div class = "well">
<center>
<h1 style="color: white;"><strong>Social Circle</strong></h1>
</center>
</div>
</div>
</div>
<div class = "row">
<div class = "col-sm-12">
<div class = "main-content">
<div class = "header">
<h3 style="text-align : center"><strong>Forget Password.</strong></h3><hr>
</div>
<div class="l_pass">
<form action="" method="POST">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
<input type="email" name="email" id="email" class="form-control" placeholder="Enter your Email..." required>
</div><br>
<hr>
<pre class = "text">Enter your bestfriends name down below ?</pre>
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-user"></i></span>
<input type="text" name="recovery_account" id="msg" class = "form-control" placeholder="Someone..." required>
</div><br>
<a href="signin.php" style="text-decoration: none;float:right;color: #187fab" data-toggle = 'tooltip' title="Signin" >
Back to Signin?
</a><br> <br>
<center><button id="signup" class="btn btn-info btn-lg" name="submit">Submit</button></center>
</form>
</div>
</div>
</div>
</div>
</body>
</html>
<?php
session_start();
include("includes/connection.php");
if (isset($_POST['submit'])) {
$email = htmlentities(mysqli_real_escape_string($con, $_POST['email']));
$recovery_account = htmlentities(mysqli_real_escape_string($con,$_POST['recovery_account']));
$select_user = "select * from users where user_email='$email' AND recovery_account = '$recovery_account'";
$query= mysqli_query($con, $select_user);
$check_user = mysqli_num_rows($query);
if($check_user == 1){
$_SESSION['user_email'] = $email;
echo "<script>window.open('change_password.php', '_self')</script>";
}else{
echo"<script>alert('Your Email or BestFriend is incorrect')</script>";
}
}
?>