It's easy to tell which button was clicked from a set of buttons if each of the button has a unique name, and the name is known at the time of backend processing (when retrieving the data sent from the form, in a php script). Even easier if the set contains not more than 2-3 buttons. But what to do when button names are unique, but not known, and set contains more than 20 buttons. To explain further, I am using an example:
Consider Facebook's add friend module. The site checks current user's (account owner's) city/school or other related data, performs a database query, retrieves a random list of users from same city/school. The template presents the list where each raw has a blue button saying 'Add Friend' at its right corner and user info at its left. No one other than the current user knows which button is going to be clicked. Now assume one funny thing, that non of the fb engineers know what AJAX or JS is. In this case, how to retrieve the unique ID of the user whose ADD FRIEND button was clicked and process database queries in order to send him/her a friend request and insert/update rows accordingly. I couldn't find a way to retrieve the unique value (that could have been assigned as the value of button's 'name' attribute) of the clicked button to process ahead.
One potential option is to have multiple hidden forms that have all the different 'Add Friend' buttons for example:
<form method="post" action="addFriend.php">
<input type="hidden" name="userid" value="123" />
<input type="submit" name="add" value="Add Friend" />
</form>
If you have multiple forms like this and just changed the value of the "userid" input you could click on each form and it would go to a page to add that user.
If you are wanting to do this without a page refresh or relocation then I believe the only way you can do it is through AJAX