<?php
include("includes/header.php");
if (isset($_POST['submit'])) {
$birth_year = $_POST['birth_year'];
$current_year = date("Y");
$age = $current_year - $birth_year;
echo('<h1>Your Age Calculation</h1>');
echo("Birth Year: $birth_year <br>");
echo("Current Year: $current_year <br>");
echo("You are approximately $age years old. <br>");
echo("<h1>Your AGE is $age</h1>");
} else {
// Show the input form
echo('<h1>Enter Your Birth Year</h1>');
echo('<form method="post" action="">');
echo('Birth Year: <input type="number" name="birth_year" required><br><br>');
echo('<input type="submit" name="submit" value="Calculate Age">');
echo('</form>');
}
include("includes/footer.php");
?>