<?php
include('assets/inc/config.php');
date_default_timezone_set('America/New_York');

$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$pass = $_POST['password'];
$password = md5($pass);
$membership_type = $_POST['membership_type'];
$date = date('y-m-d h:i:s');

$chkUser = "SELECT * FROM `tbl_register` where `email` = '$email' AND `password` = '$password' ";
$result = mysqli_query($conn, $chkUser);
if (mysqli_num_rows($result) > 0) {
    echo 2;
} else {
    $sql = "INSERT INTO `tbl_register`(`first_name`, `last_name`, `email`, `password`, `phone`, `membership_type`, `status`, `created_date`) VALUES  ('$first_name','$last_name','$email','$password','$phone','$membership_type','active','$date') ";
    mysqli_query($conn, $sql);
    echo 1;
}





?>