prepare("SELECT `id`, `expires_at` FROM `published_pages` WHERE `management_token` = ?"); $stmt->execute([$token]); $page = $stmt->fetch(); if ($page) { $new_expires_at = date('Y-m-d H:i:s', strtotime('+60 days')); $update_stmt = $pdo->prepare("UPDATE `published_pages` SET `expires_at` = ? WHERE `id` = ?"); $update_stmt->execute([$new_expires_at, $page['id']]); echo "
"; echo "

Success!

"; echo "

Your page's lifetime has been extended by 60 days.

"; echo "

New expiration date: " . $new_expires_at . "

"; echo "
"; } else { echo "
"; echo "

Error!

"; echo "

Invalid management token.

"; echo "
"; } } catch (PDOException $e) { error_log("DB Error: " . $e->getMessage()); echo "
"; echo "

Error!

"; echo "

An error occurred while processing your request.

"; echo "
"; } } else { header('Location: index.php'); exit; }