<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Area Calculation</title>
</head>
<body>
<h1>Calculate the Area of a Rectangle</h1>
<form method="post" action="">
<label for="width">Width:</label>
<input type="number" name="width" id="width" required>
<br>
<label for="height">Height:</label>
<input type="number" name="height" id="height" required>
<br>
<input type="submit" value="Calculate Area">
</form>
<?php
// Include the header file
include('includes/header.php');
if ($_SERVER["REQUEST_METHOD"] == "POST") {
// Step 2: Collecting form data
$width = $_POST['width'];
$height = $_POST['height'];
// Step 3: Performing the calculation
$area = $width * $height;
// Step 4: Presenting the results
echo "<h2>Results</h2>";
echo "<p>The area of the rectangle is: <strong>$area</strong> square units.</p>";
}
include('includes/footer.php');
?>
</body>
</html>