duandaotuo5542 2011-07-22 19:34
浏览 35

PHP复选框验证

I want to validate a PHP form with checkboxes preferably using Javascript or otherwise the client side code id:

Branch Features:</br>      
Micro Centre:<input type='checkbox' value='micro' name='features[]'>High Value Branch:<input type='checkbox' value='highval' name='features[]'>
        CBS Enabled:<input type='checkbox' value='cbs' name='features[]'>
                Trade Finance Branch:<input type='checkbox' value='tradef' name='features[]'>                 
        Personnel Banking Branch:<input type='checkbox' value='personnel' name='features[]'> 
                 High Security Branch:<input type='checkbox' value='hsbranch' name='features[]'>

and so on.. Basically on the server side I enter a Y in the database if the box is checked and a N if its unchecked. How exactly can I go about this?

  • 写回答

3条回答 默认 最新

  • doukun8670 2011-07-22 19:40
    关注

    Don't be afraid and get your hands dirty! Make a simple example of HTML form with few checkboxes and the POST method, and then make simple PHP code which dumps the content of $_POST (e.g. like:

    echo "<pre>";
    var_dump($_POST);
    echo "</pre>";
    

    And see what is coming there... Then just process it and that's it!

    评论

报告相同问题?

悬赏问题

  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入