This commit is contained in:
Suvodip
2024-12-24 18:52:08 +05:30
parent aa687679f2
commit 501d623e74
23 changed files with 39 additions and 13 deletions

View File

@@ -9,7 +9,9 @@
if ($urlParts[1] === 'notice') {
$slug = $urlParts[2];
} else {
} elseif($urlParts[1] === 'departments'){
$slug = $urlParts[2];
} else{
$slug = $urlParts[1];
}
@@ -21,13 +23,12 @@
$totalPageContent = $headerContent . $pageContent . $footerContent;
$filePath = __DIR__ . '/' . $fileName;
// if (file_put_contents($filePath, $totalPageContent)) {
// // echo "<p class='text-success'>Page saved successfully at $filePath.</p>";
// } else {
// // echo "<p class='text-danger'>Failed to save the page.</p>";
// }
if (file_put_contents($filePath, $totalPageContent)) {
// echo "<p class='text-success'>Page saved successfully at $filePath.</p>";
} else {
// echo "<p class='text-danger'>Failed to save the page.</p>";
}
}
try {
$conn = new PDO("mysql:host=$mariaServer;dbname=$mariaDb", $mariaUser, $mariaPass);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);