Php retrieves the checkbox text box, password field, hidden field, button, and text field value

Source: Internet
Author: User
The check box can be used to select multiple items. when entering some forms, the browser sometimes needs to select multiple items (such as interests and hobbies). the check box usually exists at the same time, to facilitate value transfer, the name can be defined as an array: inputtype... the check box can be used to select multiple items. when entering some forms, the viewer sometimes needs to select multiple items (such as interests and hobbies)

Check boxes usually exist at the same time. to facilitate value transfer, the name can be defined as an array:

On the return page, you can use the count () function to calculate the size of the array and use the for loop statement to output the value of the selected check box:

 

Obtains the text box, password field, hidden field, button, and text field values.

The methods for getting the values of the text box, password domain, hidden domain, button, and text domain are the same. the name attribute is used to obtain the desired value, therefore, do not repeat the name value to avoid obtaining the wrong value.

The following example shows how to use $ _ post [] to obtain the values of the text box, password field, hidden field, button, and text field:

 Password :". $ _ post [pw]; // enter the submitted data} // Display result: // the password you entered is zero // The password is 123456 // user name: // password:

Obtain the value of the single button

Radio single-choice buttons are generally grouped and have the same name value and different value values. only one value can be selected at a time in a single-choice button.

The following describes how to obtain the value of a single shard through a specific instance. the instance code is as follows:

 

Tutorial link:

Reprint at will ~ However, please keep the tutorial address★

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.