<?php

require 'connection.php';
$conn        = Connect();
$name        = $conn->real_escape_string($_POST['full_name']);
$company     = $conn->real_escape_string($_POST['company']);
$email       = $conn->real_escape_string($_POST['email']);
$telephone   = $conn->real_escape_string($_POST['telephone']);
$product     = $conn->real_escape_string($_POST['product']);
$comments    = $conn->real_escape_string($_POST['comments']);
$query       = "INSERT into tb_cform (full_name,company,email,telephone,product,comments) VALUES('" . $name . "','" . $company . "','" . $email . "','" . $telephone . "','" . $product . "','" . $comments . "')";
$success = $conn->query($query);

if (!$success) {
    die("Couldn't enter data: ".$conn->error);

}

echo "Thank You For Contacting Us <br> You may close this window.";

// echo <div style="font-family:'Segoe UI', 'Segoe UI Light', Helvetica, Garuda, Arial, sans-serif; margin:0 auto; margin-top:50px; width: 500px"> ;
// echo    <h2 style="color:rgb(110, 187, 31); font-family:'Segoe UI Light'">Thank you for contacting us.</h2>;
// echo    <p>We value our customers and your opinion.</p>;
    
// echo    <p>Please close this window to return to your session.</p>;
    
// echo    <button type="button" onclick="window.open('', '_self', ''); window.close();">Close</button>;
 
// echo</div>;


$conn->close();

?>