-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforget_password_ckeck.php
100 lines (95 loc) · 2.68 KB
/
forget_password_ckeck.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
<html>
<head>
<link rel="shortcut icon" type="image/x-icon" href="site_logo.jpg"/>
<title>Mingle in Jingle</title>
<link rel="stylesheet" type="text/css" href="please_log_in_css.css">
</head>
<div class="header">
<div id="wrapper">
<div class="logo">
<img src="mingle.png" alt="image not displayed"/>
</div>
<div id="menu">
<a href="index.php">Sign Up</a>
</div>
</div>
</div>
</body>
</html>
<?php
require 'database_open.inc.php';
session_start();
if(isset($_POST['E']) && !empty($_POST['E']))
{
$email = mysql_real_escape_string($_POST['E']);
$_SESSION['vce_email'] = $email;
$query = "SELECT `email` FROM `users` WHERE email='$email'";
if($query_run = mysql_query($query))
{
if(mysql_num_rows($query_run) == NULL)
{
echo '<div style="
margin-top:160px;
margin-left:0px;
position:absolute;
height:50px;
width:1340px;">
<pre style="color:rgb(70,120,180);font-size:35px;text-align:center;margin-top:5px">Your email is not registered</pre>
</div>';
}
else
{
$query1 = "SELECT `Password` FROM `users` WHERE email='$email'";
$query_run1 = mysql_query($query1);
$query_data = mysql_fetch_assoc($query_run1);
$answer = $query_data['Password'];
$number = rand(100000,999999);
$query5 = "UPDATE `users` SET `vce`='$number' WHERE `email`='$email'";
mysql_query($query5);
$message = "Verification Code is: ".$number;
$subject = "MingleTeam Password Recovery Mail";
mail($email,$subject,$message);
if(true)
{
echo '<div style="
margin-top:160px;
margin-left:0px;
position:absolute;
height:50px;
width:1340px;">
<pre style="color:rgb(70,120,180);font-size:30px;text-align:center;margin-top:5px;font-style:catulla">A verification code
has been sent to your Email Address.</pre>
</div>';
echo '<div style="margin-top:250px;
margin-left:530px;
position:absolute;
height:150px;
width:380px;">
<form action="check_vfc.php" method="POST">
<pre>
<input type="text" placeholder="Enter the Verification Code" name="VC" required></input><br>
<input type="submit" value="Verify">
</pre>
</form>
</div>';
}
else
{
echo '<div style="
margin-top:160px;
margin-left:0px;
position:absolute;
height:50px;
width:1340px;">
<pre style="color:rgb(70,120,180);font-size:30px;text-align:center;margin-top:5px;font-style:catulla">There is a problem sending the email.
Try Again</pre>
</div>';
}
}
}
}
else
{
header('Location: please_log_in.html');
}
?>