$db_file = __DIR__ . '/db/cms.sqlite'; try { $db = new PDO("sqlite:$db_file"); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $stmt = $db->prepare("SELECT content FROM pages WHERE slug = 'contact-us'"); $stmt->execute(); $page = $stmt->fetch(PDO::FETCH_ASSOC); $content = $page ? json_decode($page['content'], true) : []; } catch (Exception $e) { $content = []; } $page_title = isset($content['page_title']) ? $content['page_title'] : 'Contact Us'; ?> echo htmlspecialchars($page_title); ?>
$html = isset($content['main_content']) ? $content['main_content'] : ''; $html = str_replace('action="/contact-us/#wpcf7-f24-p73-o1"', 'action=""', $html); $html = str_replace('
', $form_status . '
', $html); echo $html; ?>