|
Server IP : 217.21.85.138 / Your IP : 216.73.216.103 Web Server : LiteSpeed System : Linux in-mum-web906.main-hosting.eu 4.18.0-553.37.1.lve.el8.x86_64 #1 SMP Mon Feb 10 22:45:17 UTC 2025 x86_64 User : u915722082 ( 915722082) PHP Version : 7.4.33 Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF Directory (0755) : /home/u915722082/public_html/js/../pms/admin/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
session_start();
require_once '../config/config.php';
require_once '../config/db.php';
$success = '';
$error = '';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$email = trim($_POST['email'] ?? '');
if (empty($email)) {
$error = "Please enter your email address";
} elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
$error = "Invalid email format";
} else {
$stmt = mysqli_prepare($con, "SELECT uid, fname FROM tbl_user WHERE email = ? AND status = 'active'");
mysqli_stmt_bind_param($stmt, "s", $email);
mysqli_stmt_execute($stmt);
$result = mysqli_stmt_get_result($stmt);
if ($user = mysqli_fetch_assoc($result)) {
// Generate reset token (you'll need to create a password_resets table)
$success = "If an account exists with this email, you will receive password reset instructions.";
// TODO: Implement email sending with reset link
// For now, just show success message
} else {
// Don't reveal if email exists or not (security best practice)
$success = "If an account exists with this email, you will receive password reset instructions.";
}
mysqli_stmt_close($stmt);
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Forgot Password - TDS Admin Hub</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="shortcut icon" href="../assets/media/logos/favicon.ico" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Inter:300,400,500,600,700" />
<link href="../assets/plugins/global/plugins.bundle.css" rel="stylesheet" type="text/css" />
<link href="../assets/css/style.bundle.css" rel="stylesheet" type="text/css" />
<style>
body {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
</style>
</head>
<body id="kt_body" class="app-blank">
<div class="d-flex flex-column flex-root" id="kt_app_root">
<div class="d-flex flex-column flex-center flex-column-fluid">
<div class="d-flex flex-center flex-column flex-lg-row-fluid">
<div class="w-lg-500px p-10 bg-body rounded shadow-sm">
<form class="form w-100" method="POST">
<div class="text-center mb-10">
<img alt="Logo" src="../assets/media/logos/LOGO.png" class="h-60px mb-5" />
<h1 class="text-gray-900 fw-bolder mb-3">Forgot Password?</h1>
<div class="text-gray-500 fw-semibold fs-6">
Enter your email to reset your password
</div>
</div>
<?php if ($error): ?>
<div class="alert alert-danger">
<div class="alert-text font-weight-bold"><?php echo htmlspecialchars($error); ?></div>
</div>
<?php endif; ?>
<?php if ($success): ?>
<div class="alert alert-success">
<div class="alert-text font-weight-bold"><?php echo htmlspecialchars($success); ?></div>
</div>
<?php endif; ?>
<div class="fv-row mb-8">
<label class="form-label fw-bolder text-gray-900 fs-6">Email</label>
<input class="form-control form-control-solid"
type="email"
name="email"
placeholder="Enter your email"
autocomplete="off"
required />
</div>
<div class="d-flex flex-wrap justify-content-center pb-lg-0">
<button type="submit" class="btn btn-primary me-4">
<span class="indicator-label">Submit</span>
</button>
<a href="login.php" class="btn btn-light">Cancel</a>
</div>
</form>
</div>
</div>
</div>
</div>
<script src="../assets/plugins/global/plugins.bundle.js"></script>
<script src="../assets/js/scripts.bundle.js"></script>
</body>
</html>