<?php
include("db_connect.php");

$customer_name = $_POST['customer_name'];
$phone = $_POST['phone'];

if (empty($customer_name) || empty($phone)) {
    header("Location: customer_details.php?error=1");
    exit();
}

mysqli_query($conn, "INSERT INTO customers (customer_name, phone) VALUES ('$customer_name', '$phone')");

header("Location: customer_details.php?added=1");
exit();
?>
