dquv73115 2015-02-17 22:52
浏览 32

HTML复选框将视图位置重置为页面的开头

I've used code from this topic which is also visible here. I've generated number of checkboxes in PHP for a few options but when I check an option(s) and and submit a form, my PHP doesn't recognize the checkboxes' names. Through some analysis, my conclusion is that it is because those button-like checkboxes aren't really checkboxes. Is this true and, if so, is there any way to get PHP to recognize these checkboxes?

$_POST['checkBoxName']

generates "Undefined index: checkBoxName"

  • 写回答

1条回答 默认 最新

  • dphg63476 2015-02-17 23:55
    关注

    The index of the $_POST variable is the name of the submitted input in the form. Based on the HTML code provided,

    <input type="checkbox" hidden="" value="bathroom" name="place[]">
    

    $_POST['checkBoxName'] will not do anything since the name of the input is an array called place. Instead you want to either change the name from place to checkBoxName or do $_POST['place'].

    评论

报告相同问题?

悬赏问题

  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端
  • ¥15 基于PLC的三轴机械手程序
  • ¥15 多址通信方式的抗噪声性能和系统容量对比
  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题
  • ¥15 finalshell节点的搭建代码和那个端口代码教程
  • ¥15 Centos / PETSc / PETGEM