There are many ways to do this. Here are some pointers that should help.
If you assign a name to a button, its value will be part of the $ _POST array.
<input type="submit" name="submit" value="update"></input>
<input type="submit" name="submit" value="submit"></input>
Depending on which button is pressed, it $_POST['submit']will be “updated” or “send”.
Another way to do this is to set the hidden input value in the onclick function.
<input type="hidden" id="action" name="action" value="">
<input type="submit" value="update" onclick="document.getElementById('action').value = 'update'" />
Then it $_POST['action']will be “updated” if they clicked the update button.
To update by clicking the update button, do the following:
if (isset($_POST['action']) && $_POST['action'] == 'update')
{
}
source
share