nerdexam
Zend

200-710 · Question #83

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 button has been clicked. See the full explanation below for the reasoning.

Web Features

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 depending on which button has been clicked.
  • 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 button has been clicked.

How the community answered

(47 responses)
  • A
    2% (1)
  • B
    11% (5)
  • C
    6% (3)
  • D
    81% (38)

Topics

#HTML forms#$_POST#form submission#submit buttons

Community Discussion

No community discussion yet for this question.

Full 200-710 Practice