<?php 
include ('database.php');
session_start();

if(isset($_POST['submit']));
{
    
    $name = mysqli_real_escape_string($connection, $_POST['name']);
    $email = mysqli_real_escape_string($connection, $_POST['email']);
	$message = mysqli_real_escape_string($connection, $_POST['message']);
	$id = mysqli_real_escape_string($connection, $_POST['id']);
  
	 //register users data
	 $query = "INSERT INTO `contact` (`id`, `name`, `email`, `message`) VALUES ('$id', '$name', '$email', '$message')";
     $query_run = mysqli_query($connection, $query);
 if($query_run)
 {

	  $_SESSION['status'] = "<h5 style='padding:8px; background: #1a1849; border-radius: 10px; color: #fff; text-align: center;'>Message Received</h5>";
    
	 header("location: ../contact.php"); 
 }
 else
 {
	 
 }
}
?>