<?php

include 'config.php';
if (isset($_POST['msg'])) {

    $type = $_POST['type'];
    $msg = $_POST['msg'];
    $em = $_POST['em'];

    $q  = "INSERT INTO `contact`(`em`, `topic`, `message`, `unread`) 
                      VALUES ('$em','$type','$msg','1')";

    $fire = mysqli_query($conn, $q);
    if ($fire) {
        echo "1";
    } else {
        echo "0";
    }

} else {
    error();
}
