Home  >  Article  >  Backend Development  >  PHP处置Checkbox复选框表单提交

PHP处置Checkbox复选框表单提交

WBOY
WBOYOriginal
2016-06-13 12:13:27871browse

PHP处理Checkbox复选框表单提交

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

表单代码:


  复选框1:  复选框2:  复选框3:   

PHP处理表单代码:

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


Statement:
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