<html>
    <head>
        <title>Valid Input</title>
        <link href="//yorktown.cbe.wwu.edu/sandvig/mis314/assignments/style.css" rel="stylesheet" type="text/css">
    </head>
    <body>
        <div class="pageContainer centerText">
            <h2>Valid Input</h2><hr>
            <form>
                <p>Iterations:
                    <input type="text" name="rows" size="5" autofocus>
                    <input type="submit" value="Loop">
                </p>
            </form>
            <table class="simpleTable">
            <?php 
                if (isset($_GET['rows']) && is_numeric($_GET['rows']) && $_GET['rows'] >= 1 && $_GET['rows'] <= 10) {
                    $max_iter = intval($_GET['rows']);
                    for ($i = 1; $i < $max_iter + 1; $i++) {
                        echo "<tr><td>Iteration: $i</td></tr>";
                    }
                } elseif (isset($_GET['rows'])) {
                    echo "<tr><td>Please enter a numeric value between 1 and 10.</td></tr>";
                }
            ?>
            </table>
        </div>
    </body>
</html>
