<!DOCTYPE html>
<html>
<head>
	<title></title>
</head>
<body>
	<center>
		<h2>Add New Places</h2>
	<form action="" enctype="multipart/form-data" method="POST">
	    Enter Location Name:<input type="text" name="name"><br>
		Enter Latitude     :<input type="text" name="lat"><br>
		Enter Longtude     :<input type="text" name="long"><br>
		Enter Location Image:<input type="file" name="images"><br>
		<input type="submit" name="submit">
	</form>
	</center>

</body>
</html>
<?php 
include "connection.php";
if(!empty($_POST)){
	
	

	$name=$_POST['name'];
	$lat=$_POST['lat'];
	$long=$_POST['long'];
	$image=$_FILES['images']['name'];
	$temp=$_FILES['images']['tmp_name'];
	$upload="image/".$image;
	$sql="INSERT INTO location (location_name,latitude,longtitude,images)VALUES('$name','$lat' ,'$long','$image')";
	$result=mysqli_query($conn,$sql);
	if($result){
		if(move_uploaded_file($temp,$upload)){
			echo "<script>alert('Location Added Successfully');</script>";
		}
	}
}
?>