Whether to migrate operations when you submit a form on another page?

I do not know how correctly formulated a question, but briefly, differently did not work :)
The essence of the following: A php page with 9 forms to send, the html code is rather long (at least for me), well, in php also written 9 operation when the form is submitted and, if necessary, edit the code or design was hard to orentiruetsya.
The idea to move the scripts to be executed when submitting a form to another file and specify the address in the input action, then perform a redirect back to the previous page. But searching the Internet about it found nothing. That's because nobody does?))
Are there any cons in this approach?
September 19th 19 at 00:21
3 answers
September 19th 19 at 00:23
In principle, you are offered a normal variant, but it usually goes directly to the ajax processing form data, so we do not to go anywhere from the page, and the option of redirecting back to an event when the user has disabled javascript
As usual a compromise. Yes, the processing logic is separated from the output form, but immediately get that if in the output you need to add the field, do not forget to specify the processing in a different place... - Chanel14 commented on September 19th 19 at 00:26
September 19th 19 at 00:25
And who hinders to use an include?
Nothing, just my version seemed to me more pleasant and comfortable for me personally. If there is no difference, would prefer to use it. - Chanel14 commented on September 19th 19 at 00:28
What's your version of the "nicer" and "easier" include? You have what task? Post the form and handler? Includ solve it? Some additional actions of the type of change action form required? No. Where is the pleasure? - Cierra.Weber commented on September 19th 19 at 00:31
: I do not know, probably the fact that I myself thought of this before :). And includ too easy. I understand that to do everything as simply one of the main rules, but I'm only learning and I want to try everything in different ways. - Seth commented on September 19th 19 at 00:34
read about the pattern POST/Redirect/GET. While you're at the same address - it works. But if different, then in case of error you have form data and error messages to pass through session - Cierra.Weber commented on September 19th 19 at 00:37
September 19th 19 at 00:27
You are difficult to understand. Show me the code.

Find more questions by tags PHP