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.