<?php
include('../includes/header.php');
error_reporting(E_ALL);
echo('<h1>Carla\'s Loops and Decisions Example</h1>');
if (isset($_GET['number']) && $_GET['number'] !== '') {
$number = $_GET['number'];
if (is_numeric($number) && $number % 2 == 0) {
echo "<h2>$number is an even number</h2>";
}
else {
echo "<h2>$number is an odd number</h2>";
}
}
?>
<form action="my-loops-example.php" method="GET">
<label for="number">Enter a Number:</label>
<input type="number" id="number" name="number">
<input type="submit" value="Submit">
</form>
<?php
include('../includes/footer.php');
?>