diff --git a/.hta_404.php b/.hta_404.php index 208fb9d..7b5fe3d 100644 --- a/.hta_404.php +++ b/.hta_404.php @@ -1,41 +1,61 @@ 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 = $conn->prepare("SELECT * FROM `scc24` WHERE type='page' AND `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 = '
-

'.$content[0]['title'].'

-
'.$content[0]['content'].'
-
'; - else $pageContent = ' -

Page not found (404).

+ + if (isset($content[0]['content']) && $content[0]['content']) { + $pageContent = ' +
+
+

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

+
+
' . $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) { - $in_page_message = "

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

"; + $pageContent = "

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

"; } // Render page content here @@ -43,22 +63,6 @@ $footerContent = file_get_contents('./.hta_footer.php'); - // if($fileExtension[1] && $fileExtension[1] === 'html'){ - // $filePath = __DIR__ . '/notice/' . $fileName; - // } else{ - // $filePath = __DIR__ . '/notice/' . $fileName . '.html'; - // } + // Function to save HTML file - - if($urlParts[1] === 'notice'){ - $filePath = __DIR__ . '/notice/' . $fileName; - $totalPageContent = $headerContent . $pageContent . $footerContent; - } else{ - $filePath = __DIR__ . '/.hta_slug/' . $fileName; - $totalPageContent = $headerContent . $pageContent . $footerContent; - } - - - file_put_contents($filePath, $totalPageContent); - -?> \ No newline at end of file +?> diff --git a/.hta_config/env.php b/.hta_config/env.php index 5c45e9f..d4c1412 100644 --- a/.hta_config/env.php +++ b/.hta_config/env.php @@ -1,6 +1,6 @@ -

+

Social Media Presence

diff --git a/.hta_header1.php b/.hta_header-preserved.php similarity index 89% rename from .hta_header1.php rename to .hta_header-preserved.php index c4f1acb..2db01aa 100644 --- a/.hta_header1.php +++ b/.hta_header-preserved.php @@ -1,6 +1,3 @@ - - @@ -23,7 +20,7 @@
-
+
@@ -140,7 +137,7 @@
@@ -249,40 +246,40 @@
- -
- -
- -
-
@@ -160,12 +173,12 @@
(Arts and Science)
-

Prafullanagar, Habra, 24Pgs(N) Pin-743268, W.B

-

sreechaitanyacollege@rediffmail.com

+

Prafullanagar, Habra, 24Pgs(N) Pin-743268, W.B

+

sreechaitanyacollege@rediffmail.com

-
College Meuseum
-
Campus 360°
+
College Meuseum
+
Campus 360°
@@ -242,74 +255,64 @@ -