Back to Login

Password Recovery

Enter your email address and we'll send you a link to reset your password.

SERVER['REQUEST_METHOD'] === 'POST') { $email = trim(
Back to Login

Password Recovery

Enter your email address and we'll send you a link to reset your password.

POST['email'] ?? ''); if (!empty($email) && filter_var($email, FILTER_VALIDATE_EMAIL)) { $db = Database::connect(); // Always respond generically to prevent email enumeration set_flash('success', 'If an account exists with that email, a password reset link has been sent.'); $stmt = $db->prepare("SELECT id, name FROM users WHERE email = ? LIMIT 1"); $stmt->execute([$email]); $user = $stmt->fetch(); if ($user) { $token = bin2hex(random_bytes(32)); // Expire in 30 minutes $expiry = date('Y-m-d H:i:s', strtotime('+30 minutes')); $insert = $db->prepare("INSERT INTO password_resets (email, token, expiry) VALUES (?, ?, ?)"); if ($insert->execute([$email, $token, $expiry])) { $reset_link = (isset(
Back to Login

Password Recovery

Enter your email address and we'll send you a link to reset your password.

SERVER['HTTPS']) ? "https" : "http") . "://" .
Back to Login

Password Recovery

Enter your email address and we'll send you a link to reset your password.

SERVER['HTTP_HOST'] . "/reset-password.php?token=" . $token; $email_body = "Hi {$user['name']},

You requested a password reset. Please click the link below to reset your password. This link will expire in 30 minutes.

$reset_link

If you did not request a password reset, please ignore this email."; if (function_exists('send_email')) { send_email($email, "Password Reset Request", $email_body); } } } } else { set_flash('error', 'Please enter a valid email address.'); } header("Location: /forgot-password.php"); exit; } $page_title = "Forgot Password - " . SITE_NAME; $no_navbar = true; $no_footer = true; $body_class = "rr-auth-body"; require_once __DIR__ . '/includes/header.php'; ?>
Back to Login

Password Recovery

Enter your email address and we'll send you a link to reset your password.