Whenever I need to process a form I use the approach given here (an OnLamp.com article by David Sklar). The basic idea is to divide your form into three parts: showing, validating and processing. Since the submit button re-calls the form itself, there has to be a function to choreograph the logic depending on whether you are showing the form for the first time, validating, or processing.
I find this to be an awkward approach. I don't much like the idea of using the same form (or module, I suppose) to do three very different things. I also don't like getting and reestablishing all the data I need to keep everything in line. Finally I find myself using global variables all over the place.
Maybe I just don't have the technique down, but I'm hoping there is a better way of doing this. I realize that ultimately we're dealing with HTML, and maybe I've been spoiled with some of the things available in other more Object Oriented environments.
So, does anyone have a better approach?