Reset Password
Enter your email and we'll send you a reset link.
Remembered your password? Sign In
prepare('SELECT id, name FROM users WHERE email = ?'); $stmt->execute([$email]); $user = $stmt->fetch(); if ($user) { $token = bin2hex(random_bytes(32)); $expiry = date('Y-m-d H:i:s', strtotime('+1 hour')); $update = db()->prepare('UPDATE users SET reset_token = ?, reset_expires_at = ? WHERE id = ?'); $update->execute([$token, $expiry, $user['id']]); $host = $_SERVER['HTTP_HOST'] ?? 'localhost'; $protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') ? 'https' : 'http'; $reset_link = "$protocol://$host/reset-password.php?token=$token"; $subject = 'Reset Your Password'; $name = htmlspecialchars($user['name'] ?? 'User'); $html = "
Hello $name,
You recently requested to reset your password for your $project_name account. Click the button below to reset it. This link is valid for 1 hour.
If you did not request a password reset, please ignore this email or contact support if you have concerns.
© " . date('Y') . " $project_name. All rights reserved.
Enter your email and we'll send you a reset link.
Remembered your password? Sign In