PHP处置Checkbox复选框表单提交

WBOY
Release: 2016-06-13 12:13:27
Original
872 people have browsed it

PHP处理Checkbox复选框表单提交

PHP表单提交页面复选框的名称后要加[],这样在接收页面才能得到正确的结果。表单提交后得到的是一个数组,然后通过访问数组元素得到表单的具体vaule值。得到的checkbox1的值,默认有换行。

表单代码:

Copy after login
  复选框1:  复选框2:  复选框3:   

PHP处理表单代码:

<?php    if(isset($_POST["Download"]))   {     foreach($_REQUEST[&#39;checkbox1&#39;] as $checkbox1)     {          echo  $checkbox1;     }   }?>
Copy after login


Related labels:
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