Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/293.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
复选框数组html php_Php_Html_Forms_Web - Fatal编程技术网

复选框数组html php

复选框数组html php,php,html,forms,web,Php,Html,Forms,Web,我很难在表单中设置一个复选框,然后将其传递到.php文件。。 html看起来像 <td><label for="services">Services Requested:</label></td> <td><form name="services" action="processForm.php" method="post"> <input type="checkbox" name="service

我很难在表单中设置一个复选框,然后将其传递到.php文件。。 html看起来像

<td><label for="services">Services Requested:</label></td>
<td><form name="services" action="processForm.php" method="post">
          <input type="checkbox" name="services[]" value="Massage" />Massage
          <input type="checkbox" name="services[]" value="Facial" />Facial
          <input type="checkbox" name="services[]" value="Manicure" />Manicure
          <input type="checkbox" name="services[]" value="Pedicure" />Pedicure
          </form>
      </td></tr>

}尝试更改复选框的名称。它们与表单同名,
submit
按钮只代表它的
form
标签,所以为了确保你没有这样做,是吗


按摩
面部
修指甲
足部护理

如果是这样,你就不应该那样做。相反,只创建一个包含所有字段的
表单
标记

尝试执行
var\u dump($\u POST)
var\u dump($services)
以查看提交表单后得到的结果提交按钮在哪里?这只是一个大表单的一部分,因此提交按钮更靠下。var\u dump($services)返回字符串(0)”“var\u dump($\u POST)呢?”?
if(empty($services)) {
$errors[] = "You must choose at least one service.";