Php obtains the values of the single-choice buttons and check boxes of form forms.

Source: Internet
Author: User
A single-choice Button, radio, usually appears in a group with the same name value and different value values. in a group of single-choice buttons, only one of them may be selected at a time. Obtains the value of a single-choice button.

In

Note: the checked attribute is used to set the meaning of the selected form element by default. when the form page is initialized, the element with the checked attribute is selected.

(3) in

(2) in

Add a PHP tag at any location outside the form element, use $ _ POST [] global variable to obtain the value of the check order, and then output it using the echo statement. The code is shown as follows:

  

(3) enter the running address in the browser and press enter to obtain the running result as shown in:

The above is the details of php getting the single-choice button of form and the check box value. For more information, see other related articles in the first PHP community!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.