<?php
require_once __DIR__ . "/includes/db.php";

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $stmt = $pdo->prepare("INSERT INTO messages (name,email,phone,message) VALUES (?,?,?,?)");
    $stmt->execute([$_POST['name'], $_POST['email'], $_POST['phone'], $_POST['message']]);
    header("Location: contact.php?sent=1");
}
