I have several sections of code that insert values into different tables in my DB.
I am wondering if there is a way to capture which button on my form has been selected so when the page reloads it only executes the one insert statement?
this is how I submit to the same page
<form name="input" action=myawesomeform.php" method="POST">
This is what my submit button looks like
<input type="submit" value="Submit" id="5050gdmyButton" />
so pretty much I want to execute one of the insert statements depending on which button was selected..
any help would be greatly appreciated.
1) You need to give name attribute to your submit button
2) when you have multiple inputs in your form and when you press one of them, then you only get that one in your php code with name attribute.
So for example:
in your php