This is a semi-newbie question.

I'd like to learn the different steps to write a small and secure form + response web application.

I'll use some JavaScript on the client (jQuery, and possibly more) to provide a form, and some PHP to handle the query.

But I'm a bit in the dark at how I should check that the user has entered all the required data, that they look kosher, require the user to use a CAPTHA, and perform a second check (sanitizing) in the PHP script before going ahead.

Do you know of a good tutorial that would provide the big picture?

Thank you.