<html>
    <head>
        <title>For Loop</title>
        <link href="//yorktown.cbe.wwu.edu/sandvig/mis314/assignments/style.css" rel="stylesheet" type="text/css">
    </head>
    <body>
        <div class="pageContainer centerText">
            <h2>For Loop</h2><hr>
            <form>
                <p>Iterations:
                    <input type="text" name="rows" size="5" autofocus>
                    <input type="submit" value="Loop">
                </p>
            </form>
            <?php 
                if (isset($_GET['rows']) && is_numeric($_GET['rows'])) {
                    $max_iter = intval($_GET['rows']);
                    echo "<div class=\"rows\">\n";
                    for ($i = 1; $i < $max_iter + 1; $i++) {
                        echo "Iteration: $i<br\n>";
                    }
                    echo "</div>\n";
                } elseif (isset($_GET['rows'])) {
                    echo "<h3>Please enter an integer.</h3>";
                }
            ?>
        </div>
    </body>
</html>
