'index'], ['My Blog Posts' => 'user_blogs']]; require_once($rootPath . '/components/banner.php'); $token = $_GET['token']; // Sanitize the trip_id to prevent SQL injection $blog_id = intval(decryptData($token, $salt)); // Ensures $trip_id is treated as an integer $user_id = $_SESSION['user_id']; $role = getUserRole(); // Fetch article info $stmt = $conn->prepare("SELECT * FROM blogs WHERE blog_id = ?"); $stmt->bind_param("i", $blog_id); $stmt->execute(); $result = $stmt->get_result(); if ($result->num_rows === 0) { die("Blog post not found."); } $article = $result->fetch_assoc(); $stmt->close(); ?>

Edit Blog

'; } else { echo '
'; }?>