if ($_SERVER['REQUEST_METHOD'] === 'POST') {
//something posted
if (isset($_POST['btnDelete'])) {
// btnDelete
} else {
//assume btnSubmit
}
}
You should always assume the first submit button to appear in the form html code. The reason is that some browsers will not send the name/value of any submit buttons if the user submits the form without clicking a button, or having the form focus on a button when they press enter. ANother case when the button name/value may not be sent is if you use certain javascript methods to submit a form.
A lot of people submit forms by simply using the enter key while focus is on an input field. It's important to pay attention to this detail, otherwise your can really frustrate your users when they submit a form, yet "nothing happens" and their data is lost.