I'm looking for a clean way to handle forms with PHP that does validation and caching of data, but doesn't require mixing PHP with the form HTML. Basically, I want to be able to write a form in pure HTML and intercept that form on it's way to it's destination, process it and either let the data go happily on it's way, or return to the form sending validation errors and the cached results back with it.
This all part of a little framework I'm developing as an aid to learning. My initial plan was to use the Routing object to sniff out GET and POST data, but that data doesn't always indicate the presence of a form.
I've been looking through this list of HTTP Headers but I'm not seeing anything that could help. Although I've never bothered looking at HTTP Headers before so I could easily be missing something.
Or is there some other reliable way of detecting form submissions?