<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sum Calculator</title>
</head>
<body>
<h1>Binita Sum Calculator</h1>
<form method="POST" action="">
<label for="num1">Enter first number:</label>
<input type="number" name="num1" id="num1" required>
<br><br>
<label for="num2">Enter second number:</label>
<input type="number" name="num2" id="num2" required>
<br><br>
<input type="submit" value="Calculate Sum">
</form>
<?php
include('includes/header.php');
// Check if the form is submitted
if ($_SERVER["REQUEST_METHOD"] == "POST") {
// Get the numbers from the form input
$num1 = $_POST['num1'];
$num2 = $_POST['num2'];
// Perform the calculation
$sum = $num1 + $num2;
// Display the result
echo "<h2>Result:</h2>";
echo "<p>The sum of $num1 and $num2 is <strong>$sum</strong>.</p>";
}
include('includes/footer.php');
?>
</body>
</html>