The responses seemed to focus on the form processing rather than data validation. Is form processing what you were looking for? Or perhaps looking for how to do validation logic...
To validate, we do a few things:
Make sure the field does not have more characters than we're expecting. If it does, we know that they circumvented the form, which may mean they may be trying to do a stack overflow attack of some kind... (i'm paranoid) - so I immediately zero out the session variables and kill the session.
If it has data, I pass the data and type of validation desired to a function in the included file. That function uses regular expressions (ereg, etc.) to determine whether the data matches what is expected; email addy, currency, username & password (no spaces, limited special characters, etc.). If it passes, then a flag is set for the field indicating that it is validated. Once all fields are validated, then the database stuff is allowed to proceed.
I have turned off magic_quotes_gpc, because I mirror input of all field back, if any field needs correcting. "On" causes special characters, like single quote to come back 'escaped' with a backslash. So with magic_quotes off, I have to add the quotes using the string function addslashes prior to setting the variable in the database.
Beware of serious validating using javascript because it can be circumvented.