<?php
ob_start();
include 'dbconnection.php';

$name = $_POST['name'];
$email = $_POST['email'];
$mobile = $_POST['mobile'];
$location = $_POST['location'];


$sql="INSERT INTO leads (name,email,mobile,location,time) 
VALUES 
( '{$name}','{$email}','{$mobile}','{$location}',NOW())";


if (!mysqli_query($conn,$sql))
  {
  die('Error: ' . mysqli_error());
  }
else 
{
header("location:../view_leads");
}
mysqli_close($conn);
ob_end_flush();
?> 