Zend
200-550 · Question #57
An HTML form has two submit buttons. After submitting the form, how can you determine with PHP which button was clicked?
The correct answer is D. Assign name and value attributes to each button and use $_GET or $_POST to find out which. See the full explanation below for the reasoning.
Question
An HTML form has two submit buttons. After submitting the form, how can you determine with PHP which button was clicked?
Options
- AAn HTML form may only have one button.
- BYou cannot determine this with PHP only. You must use JavaScript to add a value to the URL
- CPut the two buttons in different forms, but make sure they have the same name.
- DAssign name and value attributes to each button and use $_GET or $_POST to find out which
How the community answered
(32 responses)- A6% (2)
- B3% (1)
- C16% (5)
- D75% (24)
Community Discussion
No community discussion yet for this question.