<?php session_start();
if(empty($_SESSION['id'])):
header('Location:../index.php');
endif;

include('../dist/includes/dbcon.php');
	$id = $_POST['id'];
	$name =$_POST['name'];
	$amount =$_POST['amount'];
	
	
	mysqli_query($con,"update expenses set name='$name', amount='$amount' where id='$id'")or die(mysqli_error());
	
	echo "<script type='text/javascript'>alert('Successfully updated Expenses!');</script>";
	echo "<script>document.location='expenses.php'</script>";  

	
?>
