This commit is contained in:
2024-12-17 07:57:12 +00:00
parent ebbc4fbc22
commit 40750028b3
10 changed files with 4061 additions and 131 deletions

View File

@@ -4,19 +4,19 @@
$headerContent = file_get_contents('./.hta_header.php');
$requestUri = $_SERVER['REQUEST_URI'];
$parts = explode('/', $requestUri);
$slug = $parts[2];
$fileName = $slug;
$fileExtension = explode('.', $fileName);
// echo $requestUri;
$querySlug = '';
if($fileExtension[1] && $fileExtension[1] === 'html'){
$querySlug = $fileExtension[0];
$urlParts = explode('/', $requestUri);
if($urlParts[1] === 'notice'){
$slug = $urlParts[2];
} else{
$querySlug = $fileExtension[0];
$slug = $urlParts[1];
}
$querySlug = explode('.', $slug)[0];
// echo $querySlug;
$fileName = $slug;
try {
$conn = new PDO("mysql:host=$mariaServer;dbname=$mariaDb", $mariaUser, $mariaPass);
@@ -48,8 +48,16 @@
// } else{
// $filePath = __DIR__ . '/notice/' . $fileName . '.html';
// }
$filePath = __DIR__ . '/notice/' . $fileName;
$totalPageContent = $headerContent . $pageContent . $footerContent;
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);