<?php
    /*======
        (giving a different name than variant
            from try-quad example -- this one is a bit different)
            
        function: destroy_then_exit : string -> void

        purpose: expects a string describing the problem that
            led to this being called, and destroys the
            current session and responds with
            a complaint screen including that problem
            description and including a link back to the
            calling PHP
            (so it can presumably start over)
            
        requires: 328footer-plus-end.html

        last modified: 2024-04-17
    =====*/

    function destroy_then_exit($problem_descr)
    {
        session_destroy();
        ?>
        <p> Something went wrong: <br />
            <?= $problem_descr ?> </p>

        <p> <a href="<?= htmlentities($_SERVER['PHP_SELF'],
                                       ENT_QUOTES) ?>">
            Start Over </a></p>
        <?php
        require_once('328footer-plus-end.html');
        exit;
    }
?>