27 lines
1.1 KiB
PHP
27 lines
1.1 KiB
PHP
<?php
|
|
require('.hta_config/env.php');
|
|
try {
|
|
// Database connection
|
|
$conn = new PDO("mysql:host=$mariaServer;dbname=$mariaDb", $mariaUser, $mariaPass);
|
|
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
|
|
|
// Query the database
|
|
$stmt = $conn->prepare("SELECT * FROM `scc24`");
|
|
$stmt->execute();
|
|
$content = $stmt->fetch(PDO::FETCH_ASSOC);
|
|
|
|
// Check and render content
|
|
if ($content && isset($content['content']) && $content['content']) {
|
|
echo '<div class="container mx-auto">
|
|
<div style="padding-top:20px; padding-bottom:15px; font-size:25px;">
|
|
<p style="text-align: center;">' . htmlspecialchars($content['title']) . '</p>
|
|
</div>
|
|
<div>' . $content['content'] . '</div>
|
|
</div>';
|
|
} else {
|
|
echo '<div class="container mx-auto"><p style="text-align: center;">Content not found (404).</p></div>';
|
|
}
|
|
} catch (PDOException $e) {
|
|
echo "<p class='text-danger'>Error: " . htmlspecialchars($e->getMessage()) . "</p>";
|
|
}
|
|
?>
|