<?php
require_once __DIR__ . '/../config/helpers.php';
require_once __DIR__ . '/../config/db.php';
csrf_check();
$pdo = db();
$st = $pdo->prepare("INSERT INTO contact_messages(name,email,subject,message) VALUES (?,?,?,?)");
$st->execute([trim($_POST['name']), trim($_POST['email']), trim($_POST['subject']??''), trim($_POST['message'])]);
flash('ok','Pesan terkirim. Terima kasih!');
header('Location: ' . base_url('index.php#contact'));
