This repository has been archived by the owner on May 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
forgotPassword.php
70 lines (62 loc) · 1.81 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
<?php
require 'includes/mysql_connection.php';
require 'includes/config.php';
require 'includes/messages.php';
require 'backend/PasswordReset/ResetPassword.php';
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title><?php echo $WebsiteTitle; ?></title>
<link rel="icon" type="image/png" href="images/favicon-16x16.png" sizes="16x16" />
<link rel="stylesheet" href="css/styleSettings.css">
</head>
<body>
<div class="background">
<div class="back">
<form action="/index">
<input type="submit" value="Back" />
</form>
</div>
<?php
if(isset($_GET["reset"])){
if($_GET["reset"] == "success"){
?>
<div class="message-box">
<div class="isa_success">
<i class="fa fa-check"></i>
<?php echo $emailRecoverySent; ?>
</div>
</div>
<?php
}
}
?>
<div class="changebox">
<h2><?php echo $emailRecovery; ?></h2>
<h4><?php echo $emailRecoveryInstructions; ?></h4>
<form method='POST'>
<div class="inputs">
<input type="text" name="email" placeholder="Enter your e-mail address.." required></input>
<button type="submit" name="reset-request-submit"><?php echo $emailRecoveryPassword; ?></button>
</div>
</form>
<?php
if(isset($_POST['reset-request-submit']))
{
if(filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
$userInput = mysqli_real_escape_string($conn, $_POST['email']); //padariau apsauga nuo sql injection -Valentinas
echo ResetPassword($userInput);
}
else {
echo "<div style='text-align:center;'>
<p style='color:red;'>That is not a password</p>
</div>";
}
}
?>
</div>
</div>
</body>
</html>