
<?php
if (isset($_POST['contact_request'])) {
    include 'config.php';
    $name = $_POST['name'];
    $phone = $_POST['phone'];
    $email = $_POST['email'];
    $website = $_POST['website'];

    if (mysqli_query($conn, "INSERT INTO contact_request (`name`,`email`,`phone`,`website`,`status`) VALUES ('$name','$email','$phone','$website','0')")) {

        $to = 'jainrishabh818@gmail.com';
        $subject = 'Contact Request | LHK Media';
        $message = "You have a new Contact Request <br>";
        $message .= 'Name : ' . $name . '</br>';
        $message .= 'Email : ' . $email . '</br>';
        $message .= 'Phone : ' . $phone . '</br>';
        $message .= 'Website : ' . $website . '</br>';
        $headers = "From: lhkmedia <contact@lhkmedia.in>\r\n";
        $headers .= "Reply-To: contact@lhkmedia.in\r\n";
        $headers .= "Content-type: text/html\r\n"; //to make the html work in email
        mail($to, $subject, $message, $headers);
        echo "<script>alert('Callback request received, we will contact you soon!');window.location='index.php';</script>";
    }
}

include("code/head.php");
?>



<?php
include("code/footer.php");
?>  
