CODE FOLLOWS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Week 5 Personal Example</title>
</head>
<body>
<?php include("../includes/header.php"); ?>
<form method="GET" action="week-5-my-example.php">
<label for="number">Choose Number (1-30): </label>
<input type="number" id="number" name="number" min="1" max="30" required>
<input type="submit" name="submit" value="Submit">
</form>
<?php
if (isset($_GET["submit"]) && isset($_GET["number"])) {
$num = $_GET["number"];
if ($num > 30 || $num < 1) {
echo "Number must be between 1 and 30!";
} else {
for ($i = 0; $i < $num; $i++) {
for ($j = 0; $j < $num; $j++) {
echo $num . " ";
}
echo "<br>";
}
}
}
?>
<?php include("../includes/footer.php"); ?>
</body>
</html>