Show sourcecode
The following files exists in this folder. Click to view.
Webserver1/Ovningar/Slutprojekt/
.env
DEBUG/
Media/
account.js
account.php
callback_log.txt
change_account_details.php
composer.json
composer.lock
forgot_pass.php
forgot_pass_new_pass.php
header.php
index.php
login.php
mediaplayer.php
node_modules/
package-lock.json
package.json
signup.php
style.css
upload.js
upload_callback.php
upload_callback_simulated.php
upload_chunk.php
upload_errors.log
upload_form.php
upload_handler.php
upload_success.log
vendor/
verify_file.php
verifypage.php
forgot_pass.php
57 lines UTF-8 Windows (CRLF)
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
<?php
session_start();
/**
* @var PDO $dbconn
* @var bool $local
* @var class DBManager
*/
include('../../incl/dbconnection.php');
$dbmanager = new DBManager();
$email = $_POST['account-email'] ?? null;
if ($email) {
// Kolla om email tillhör något konto
if (count($dbmanager->fetch_from_table(["email"], "bay_users", ["email" => $email])) > 0) {
$verificationCode = substr(md5(uniqid(rand())),0, 6);
$_SESSION['verificationCode'] = $verificationCode;
$_SESSION['email'] = $email;
$_SESSION['verifyType'] = "FORGOT";
header("Location: verifypage.php");
exit;
}
}
?>
<!DOCTYPE html>
<html lang="sv">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ändra kontouppgifter</title>
<link rel="stylesheet" href="style.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<style>
form {
display: grid;
justify-items: center;
}
form .row {
margin: 1rem;
}
</style>
</head>
<body>
<?php include("./header.php") ?>
<form method="post">
<h1>Glömt lösenord</h1>
<label for="account-email">Epost för kontot:</label>
<input type="email" name="account-email" id="account-email">
<input type="submit" value="Skicka">
</form>
</body>
</html>