Page saved successfully at $filePath.

"; // } else { // echo "

Failed to save the page.

"; // } // } try { $conn = new PDO("mysql:host=$mariaServer;dbname=$mariaDb", $mariaUser, $mariaPass); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $stmt = $conn->prepare("SELECT * FROM `scc24` WHERE `slug` = :querySlug"); $stmt->bindParam(':querySlug', $querySlug, PDO::PARAM_STR); $stmt->execute(); $content = $stmt->fetchAll(PDO::FETCH_ASSOC); if (isset($content[0]['content']) && $content[0]['content']) { $pageContent = '
'; if ($content[0]['type'] !== 'faculty') { $pageContent .= '

' . htmlspecialchars($content[0]['title']) . '

'; } $pageContent .= '
' . $content[0]['content'] . '
'; // Call the function to save the HTML file // saveHtmlFile($fileName, $headerContent, $pageContent); } else { $pageContent = '

Page not found (404).

Back to home
'; } } catch (PDOException $e) { $pageContent = "

Error: " . $e->getMessage() . "

"; } // Render page content here echo $pageContent; $footerContent = file_get_contents('./.hta_footer.php'); // Function to save HTML file ?>