<?php
	include '../connection.php';
	$fname=ucwords($_POST['u1']);
	$mname=ucwords($_POST['u2']);
	$lname=ucwords($_POST['u3']);
	$phone=$_POST['u4'];
	$email=$_POST['u5'];
	$password=$_POST['u6'];
	$date=date("Y-m-d");
	$check="SELECT * FROM users where email='$email'";
	$result=mysqli_query($con,$check);
	if (mysqli_num_rows($result)==1) {
		echo "username already available";
	}
	else{
		$query="INSERT INTO users(fname,mname,lname,phone,email,password,dates) VALUES('$fname','$mname','$lname','$phone','$email','$password','$date')";
		$res=mysqli_query($con,$query);
		if ($res) {
			echo "Successfully Registered";
		}
		else{
			echo "something wrong...";
		}
	}

?>