<?php 
include "connection.php";
if(!empty($_POST)){
	
	
// print_r($_POST);die;
	$name=$_POST['name'];
	$lat=$_POST['lat'];
	$long=$_POST['long'];
	$temp=$_POST['temperature'];
	$pres=$_POST['preciption'];
	$wind=$_POST['wind'];
	$humidity=$_POST['humidity'];
	$cloud=$_POST['cloud'];
	// $image=$_FILES['imagess']['name'];
	// print_r($image);die;
	// $temp=$_FILES['imagess']['tmp_name'];
	// $upload="image/".$image;
	$sql="INSERT INTO location1 (location_name,latitude,longtitude,temperature,precipitation,wind,humidity,cloud)VALUES('$name','$lat' ,'$long','$temp','$pres','$wind','$humidity','$cloud')";
	$result=mysqli_query($conn,$sql);
	if($result){
		
			echo "<script>
					alert('Location Added');
					window.location.href='index.php';
					</script>";
		
	}
}
?>