<?php 
include "connection.php";
if(!empty($_POST)){
	
	
// print_r($_POST);die;
	$name=$_POST['name'];
	$lat=$_POST['lat'];
	$long=$_POST['long'];
	$image=$_FILES['imagess']['name'];
	// print_r($image);die;
	$temp=$_FILES['imagess']['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>";
		}
	}
}
?>