php - One form two submit, should I just check for $_POST boolean? -


I have found a form that will use two submit buttons to post in two different databases.

To keep one in permanent information, secondly, so that they can save and save later and later return it later. Generally, I use $ _ SERVER ["REQUEST_METHOD"] == "POST" when the user kills the submit button, but since there are multiple submit buttons, I use each button if ($ _ POST ["button1"]) {} and if ($ _ POST ["button2"]) {} ?

Is there a better way to do this? I tried to attach a click event jQuery to do this, however, when I go to a certain point, the script actually gets broken and I'm not sure why the form calls the same action page even after the submit button is pressed despite it.

if ($ _POST ["button1"] == 'your-button-value' } {}

and / or

if ($ _ POST ["button2

I am don < P>

The best option to manage / handle data is' I think you'll find anything better than this.


Comments