( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ
<?php
// Start session
session_start();
// Include database configuration file
require 'data/files/config.php'; // Ensure this file contains your database connection details
// Check if 'token' is present in the GET request
if (isset($_GET['token'])) {
$token = $_GET['token'];
// Prepare SQL statement to check if the token exists in the users table
$stmt = $pdo->prepare("SELECT id, email, reset_token FROM users WHERE reset_token = ?");
// Execute the statement with the token as a parameter
if ($stmt->execute([$token])) {
$result = $stmt->fetch(PDO::FETCH_ASSOC);
// Check if any user was found with that token
if ($result) {
// Token is valid, fetch user data
$current_time = date('Y-m-d H:i:s');
if ($current_time > $result['reset_token']) {
header("Location: auth-forgot.php?message=token+has+expired");
exit();
} else {
// Token is valid and not expired
// Add your logic here for the next steps
}
} else {
header("Location: auth-forgot.php?message=Invalid+token");
exit();
}
} else {
header("Location: auth-forgot.php?message=Error+executing+query");
exit();
}
} else {
header("Location: auth-forgot.php");
exit();
}
?>
<!DOCTYPE html>
<!-- beautify ignore:start -->
<html lang="en" class="light-style layout-wide customizer-hide" dir="ltr" data-theme="theme-default" data-assets-path="assets/" data-template="vertical-menu-template" data-style="light"><!--auth-reset-password-cover.html [XR&CO'2014],10:55:40 GMT -->
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
<title>Reset Your Password</title>
<meta name="description" content="" />
<meta name="keywords" content="">
<!-- Canonical SEO -->
<link rel="canonical" href="https://thebrand.ai/insights">
<!-- Favicon -->
<link rel="icon" type="image/x-icon" href="https://thebrand.ai/favicon/favicon.ico" />
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com/">
<link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Public+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap" rel="stylesheet">
<!-- Icons -->
<link rel="stylesheet" href="assets/vendor/fonts/boxicons.css" />
<link rel="stylesheet" href="assets/vendor/fonts/fontawesome.css" />
<link rel="stylesheet" href="assets/vendor/fonts/flag-icons.css" />
<!-- Core CSS -->
<link rel="stylesheet" href="assets/vendor/css/rtl/core.css" class="template-customizer-core-css" />
<link rel="stylesheet" href="assets/vendor/css/rtl/theme-default.css" class="template-customizer-theme-css" />
<link rel="stylesheet" href="assets/css/demo.css" />
<!-- Vendors CSS -->
<link rel="stylesheet" href="assets/vendor/libs/perfect-/perfect-scrollbar.css" />
<link rel="stylesheet" href="assets/vendor/libs/typeahead-js/typeahead.css" />
<!-- Vendor -->
<link rel="stylesheet" href="assets/vendor/libs/form-va/form-validation.css" />
<!-- Page CSS -->
<!-- Page -->
<link rel="stylesheet" href="assets/vendor/css/pages/page-auth.css?<?php echo rand(99,22222);?>">
<link rel="stylesheet" href="assets/vendor/libs/animate-css/animate.css" />
<link rel="stylesheet" href="assets/vendor/libs/sweetaler/sweetalert2.css" />
<!-- Helpers -->
<script src="assets/vendor/js/helpers.js"></script>
<!--! Template customizer & Theme config files MUST be included after core stylesheets and helpers.js in the <head> section -->
<!--? Template customizer: To hide customizer set displayCustomizer value false in config.js. -->
<script src="assets/vendor/js/template-customizer.js"></script>
<!--? Config: Mandatory theme config file contain global vars & default theme options, Set your preferred theme option in this file. -->
<script src="assets/js/config.js"></script>
</head>
<body>
<!-- Content -->
<div class="authentication-wrapper authentication-cover">
<!-- Logo -->
<a href="index" class="app-brand auth-cover-brand gap-2">
<span class="app-brand-logo demo">
<img src="img/logo.png?jjw" style="max-height:60px">
</span>
<!-- <span class="app-brand-text demo text-heading fw-bold">Brand Insights</span>-->
</a>
<!-- /Logo -->
<div class="authentication-inner row m-0">
<!-- /Left Text -->
<div class="d-none d-lg-flex col-lg-7 col-xl-8 align-items-center p-5">
<div class="w-100 d-flex justify-content-center">
<img src="assets/img/illustrations/boy-with-laptop-light.pngd6" class="img-fluid scaleX-n1-rtl" alt="Login image" width="700" data-app-dark-img="assets/img/illustrations/boy-with-laptop-dark.png" data-app-light-img="illustrations/boy-with-laptop-light.png">
</div>
</div>
<!-- /Left Text -->
<!-- Reset Password -->
<div class="d-flex col-12 col-lg-5 col-xl-4 align-items-center authentication-bg p-6 p-sm-12">
<div class="w-px-400 mx-auto mt-12 pt-5">
<h4 class="mb-1">Reset Password 🔒</h4>
<p class="mb-6"><span class="fw-medium">Your new password must be different from previously used passwords</span></p>
<form id="formAuthentication" class="mb-6" method="POST"><input type="hidden" id="token" class="form-control" name="token" value="<?php echo $token; ?>" />
<div class="mb-6 form-password-toggle">
<label class="form-label" for="password">New Password</label>
<div class="input-group input-group-merge">
<input type="password" id="password" class="form-control" name="password" placeholder="············" aria-describedby="password" />
<span class="input-group-text cursor-pointer"><i class="bx bx-hide"></i></span>
</div>
</div>
<div class="mb-6 form-password-toggle">
<label class="form-label" for="confirm-password">Confirm Password</label>
<div class="input-group input-group-merge">
<input type="password" id="confirm-password" class="form-control" name="confirm-password" placeholder="············" aria-describedby="password" />
<span class="input-group-text cursor-pointer"><i class="bx bx-hide"></i></span>
</div>
</div>
<button class="btn btn-primary d-grid w-100 mb-6 resetX">
Set new password
</button>
<div class="text-center">
<a href="auth-login.php">
<i class="bx bx-chevron-left scaleX-n1-rtl me-1_5 align-top"></i>
Back to login
</a>
</div>
</form>
</div>
</div>
<!-- /Reset Password -->
</div>
</div>
<!-- / Content -->
<!-- Core JS -->
<!-- build:js assets/vendor/js/core.js -->
<script src="assets/vendor/libs/jquery/jquery.js"></script>
<script src="assets/vendor/libs/popper/popper.js"></script>
<script src="assets/vendor/js/bootstrap.js"></script>
<script src="assets/vendor/libs/perfect-/perfect-scrollbar.bc.de"></script>
<script src="assets/vendor/libs/hammer/hammer.js"></script>
<script src="assets/vendor/libs/i18n/i18n.js"></script>
<script src="assets/vendor/libs/typeahead-js/typeahead.js"></script>
<script src="assets/vendor/js/menu.js"></script>
<!-- endbuild -->
<!-- Vendors JS -->
<script src="assets/vendor/libs/form-validat/popular.js"></script>
<script src="assets/vendor/libs/form-vali/bootstrap5.js"></script>
<script src="assets/vendor/libs/form-vali/auto-focus.js"></script>
<!-- Main JS -->
<script src="assets/js/main.js"></script>
<!-- Page JS -->
<script src="assets/js/pages-auth.js?<?php echo rand(99,22222);?>"></script>
<script src="assets/vendor/libs/sweetaler/sweetalert2.js"></script>
<script src="assets/js/extended-ui-sweetalert2.js"></script>
</body> <!--auth-reset-password-cover.html [XR&CO'2014],10:55:40 GMT -->
</html>
<!-- beautify ignore:end -->