<?php
include 'db.php';

$sender = $_POST['sender'];
$customer_ip = $_POST['customer_ip'];
$message = trim($_POST['message']);

if ($message != '') {
  $stmt = $conn->prepare("INSERT INTO messages (customer_ip, sender, message) VALUES (?, ?, ?)");
  $stmt->bind_param("sss", $customer_ip, $sender, $message);
  $stmt->execute();
}
?>
