=====
CS 328 - Week 13 Lecture 2 - 2026-04-22
=====

=====
TODAY WE WILL
=====
*   announcements
*   intro to PHP sessions, continued:
    completing try-quad.php
*   prep for next class

=====
*   should be working on Homework 10!
    *   deadline: 11:59 pm on Friday, April 24

    *   submit files OFTEN, THROUGHOUT the week!

=====
*   IT IS PREREGISTRATION for SUMMER 2026/FALL 2026!
    *   preregistration for SUMMER 2026 is open NOW for 
        ***EVERYONE***!!!

    *   preregistration for FALL 2026 begins at your
        registration appointment in your student center
	(sometime between April 13 - April 24)

=====
REMINDER: PHP SESSION-SANITY HELPERS
=====
*   draw a FINITE-STATE DIAGRAM to describe your desired web application's
    behavior!
    *   (see posted photo of informal finite state diagram for try-quad.php)

*   have a helper function for each state in your application
    logic
    *   have the first version of each be a STUB, a little
        working version of the function that just
        proclaims what you called
	*   (and including an anchor element to
	    your PHP to continue is also useful)

*   START the postback PHP for your application with an if-elseif 
    that just lays out the order these will be called,
    
    setting up a $_SESSION key to keep track of the current state

*   try-quad.php - by the end of Week 13 Lecture 1, this just had such stubs,
    and such setting up of a $_SESSION key "next_state",
    BUT note that you can try it out and "walk" through the expected
    logical session

=====
REMINDER: a useful pattern in each state of a PHP application
    using sessions:
====
*   as you are writing the function FOR a state in your application:
	
    *   What information does this state need to GET (and SANITIZE/VALIDATE) 
        from a just-submitted FORM? (typically, from the $_POST array,
        if its method="post")

    *   What information from a PREVIOUS state does this state need to get 
        FROM the $_SESSION array?

    *   What information will a LATER state possibly need that this state 
        should ADD to (or update in) the $_SESSION array?

=====