prettified password reset function

This commit is contained in:
Thies Mueller 2021-01-08 19:30:40 +01:00
parent 80fd77bbc1
commit 42f1532e50
2 changed files with 32 additions and 12 deletions

View File

@ -1,3 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="ressources/css/bootstrap.min.css" crossorigin="anonymous">
<title>Forgot Password</title>
</head>
<body>
<?php <?php
$pdo = new PDO('mysql:host=localhost;dbname=usertable', 'usertable', 'password'); $pdo = new PDO('mysql:host=localhost;dbname=usertable', 'usertable', 'password');
@ -69,11 +77,13 @@ if(isset($error) && !empty($error)) {
echo $error; echo $error;
} }
?> ?>
<script src="ressources/js/bootstrap.min.js"></script>
<form action="?send=1" method="post"> <form action="?send=1" method="post">
E-Mail:<br> <div class="form-group">
<input type="email" name="email" value="<?php echo isset($_POST['email']) ? htmlentities($_POST['email']) : ''; ?>"><br> <label for="email">Email</label>
<input type="submit" value="New Password"> 0<input type="email" name="email" id="email" class="form-control" value="<?php echo isset($_POST['email']) ? htmlentities($_POST['email']) : ''; ?>"><br>
</div>
<button type="submit" class="btn btn-primary">
</form> </form>
<?php <?php

View File

@ -1,3 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="ressources/css/bootstrap.min.css" crossorigin="anonymous">
<title>Reset Password</title>
</head>
<body>
<?php <?php
$pdo = new PDO('mysql:host=localhost;dbname=usertable', 'usertable', 'password'); $pdo = new PDO('mysql:host=localhost;dbname=usertable', 'usertable', 'password');
@ -47,14 +55,16 @@ if(isset($_GET['send'])) {
} }
} }
?> ?>
<script src="ressources/js/bootstrap.min.js"></script>
<h1>Set new password</h1> <h1>Set new password</h1>
<form action="?send=1&amp;userid=<?php echo htmlentities($userid); ?>&amp;code=<?php echo htmlentities($code); ?>" method="post"> <form action="?send=1&amp;userid=<?php echo htmlentities($userid); ?>&amp;code=<?php echo htmlentities($code); ?>" method="post">
Please enter new password:<br> <div class="form-group">
<input type="password" name="password"><br><br> <label for="password">New Password</label>
<input type="password" id="password" class="form-control" name="password"><br><br>
Confirm new password:<br> </div>
<input type="password" name="password_confirm"><br><br> <div class=form-group>
<label for="password_confirm">Confirm new Password</label>
<input type="submit" value="save change"> <input type="password" id="password" class="form-control" name="password_confirm"><br><br>
</div>
<button type="submit" class="btn btn-primary">Submit new password</button>
</form> </form>