<body>
    <span>
        <?php

        $birthday = $_POST['birthday'];
        $test_array = explode("/", $birthday);
        $firstname = $_POST['firstname'];
        $surname = $_POST['surname'];
        $course = $_POST['course'];
        $onCampus = $_POST['onCampus'];

        echo "Hello, $firstname $surname";
        echo "<br>";
        if (isset($_POST["birthday"])) {
            if (count($test_array) == 3) {
                if (checkdate($test_array[0], $test_array[1], $test_array[2])) {
                    if (($test_array[2]-2024)<-100) {
                        echo "Birthday: $birthday";
                        echo "<br>";
                    }
                    else {
                        echo "Over 100 years old";
                    }
                }
                else {
                    echo "Birthday in Incorrect Format";
                    echo "<br>";
                }
            }
        }
        echo "Course: $course";
        echo "<br>";
        echo "On Campus: ";
        if (isset($_POST['onCampus'])) {
            echo "True";
        } else {
            echo "False";
        }
        ?>
        <br>
        <a href="index.html"><button>Return to Form</button></a>
    </span>
</body>

