PHP handle Checkbox checkbox form submission

WBOY
Release: 2016-07-25 08:45:31
Original
1832 people have browsed it

Add [] after the name of the check box on the PHP form submission page, so that the correct result can be obtained on the receiving page. After the form is submitted, you get an array, and then you get the specific vaule value of the form by accessing the array elements. The value of checkbox1 obtained has line break by default.

Form code:

  1.   Check box 1:
  2.  Checkbox 2:
  3.  Checkbox 3:
  4.  
  5.  
Copy code

PHP form processing code:
  1.   if(isset($_POST["Download"]))
  2.   {
  3.   foreach($_REQUEST['checkbox1'] as $checkbox1)
  4.    {
  5.   echo $checkbox1 ;
  6.    }
  7.   }
  8. ?>
Copy code

Checkbox, PHP, Checkbox


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!