<?php
include ('db.php');

if(isset($_POST['send_message'])) {

$full_name = $_POST['full_name'];
$email = $_POST['email'];
$Phone = $_POST['Phone'];
$message = $_POST['message'];

$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$insert_query = "INSERT INTO tbl_contact (full_name, email, Phone, message)
VALUES (?, ?, ?,?)";

$insert = $conn->prepare($insert_query);
$insert->execute(array($full_name, $email, $Phone, $message));

echo "<script>alert('Successfully Send your Message!'); window.location='index.php'</script>";
}
?>