I have a feeling that all those undefineds are because the code isn’t considering initial page load. i.e. the first page load is an HTTP GET request so there will be no POST to check for. I guess you could write a whole mess of issets but wrapping in if($_SERVER['REQUEST_METHOD'] == 'POST') would likely be cleaner.
1 Like