<!DOCTYPE html>
<html>
<body>
 
<?php 

	
	if ($_SERVER["REQUEST_METHOD"] == "POST") 
	{
		$discount_id = $_POST['discount_id'];
		$discount_name = $_POST['discount_name'];
		$discount_amount = $_POST['discount_amount'];

	} 


	$host = "localhost"; 
	$username = "root";
	$password = "";
	$dbname = "WSAS";


	$con = mysqli_connect($host, $username, $password, $dbname);


	if (!$con)
	{
		die("Connection failed!" . mysqli_connect_error());
	} 


	$sql = "INSERT INTO `admindiscount`(`discount_id`, `discount_name`, `discount_amount`) VALUES ('$discount_id','$discount_name','$discount_amount')";

	$rs = mysqli_query($con, $sql);

	if($rs)

	if ($rs) {
            header("Location: ../adminpanel/admindiscount.php");
            exit;
        }


	mysqli_close($con);

?>

</body>
</html>