Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/72.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
Php 单选按钮不包括在post中_Php_Html_Netbeans - Fatal编程技术网

Php 单选按钮不包括在post中

Php 单选按钮不包括在post中,php,html,netbeans,Php,Html,Netbeans,我正在制作一个将值发布到php文件的注册表单,但是在检查netbeans中的post变量后,我发现数组中没有包含单选按钮,而所有其他输入都是 代码如下: <form id="register" action="php/register.php" method="post"> <h1>Please fill out as much as possible</h1> <h2>Would you like to register as a bul

我正在制作一个将值发布到php文件的注册表单,但是在检查netbeans中的post变量后,我发现数组中没有包含单选按钮,而所有其他输入都是

代码如下:

<form id="register" action="php/register.php" method="post">
  <h1>Please fill out as much as possible</h1>
  <h2>Would you like to register as a bulk buyer or a retail buyer?</h2>
  <div id="container">
    <div class="regForm left">
      <input type="radio" name="custType" value="Bulk"><label>Bulk buyer</label><br>
      <input id="bEmail" type="email" name="bEmail"><label>Email address</label><br>
      <input id="bPass" type="password" name="bPass"><label>Password</label><br>
      <input id="bComp" type="text" name="bCompany"><label>Company name</label><br>
      <input id="bContact" type="text" name="bContact"><label>Contact person</label><br>
      <input id="bOffice" type="tel" name="bOffice"><label>Office number</label><br>
      <input id="bMobile" type="tel" name="bMobile"><label>Mobile number</label><br>
      <input id="bVAT" type="text" name="bVat"><label>VAT number</label><br>
      <textarea id="bAddress" cols="17" rows="4"></textarea><label>Address</label>
    </div>
    <div class="regForm right">
      <input type="radio" name="custType" value="Retail"><label>Retail buyer</label><br>
      <input id="rEmail" type="email" name="rEmail"><label>Email address</label><br>
      <input id="rPass" type="password" name="rPass"><label>Password</label><br>
      <input id="rMobile" type="tel" name="rMobile"><label>Mobile number</label>
    </div>
    <div class="regForm right">
      <label>Do you wish to receive additional email marketing from us? <input id="marketingCheck" type="checkbox" name="market"></label><br>
      <input id="regSubmit" type="submit" name="submit" value="Register"><a href="" id="cancelReg">Cancel</a>
    </div>
    <div class="clear"></div>
  </div>
</form>
目前,我对php文件中的帖子不做任何处理

我可以在netbeans中发布post-var的屏幕截图,但该站点不允许我这样做。 这是打印后的结果; 数组[bEmail]=>[bPass]=>[bCompany]=>[bContact]=>[bOffice]=>[bMobile]=>[bVat]=>[rEmail]=>[rPass]=>[rMobile]=>[submit]=>注册

我看了另一篇文章,但他们似乎只是在代码或排序上有一个输入错误

谢谢

试试这个:

确保在提交前已选中单选按钮?在请求中只会看到选中的按钮


仅当选择了任何选项时,单选按钮的值才会保存在$\u POST中,因此您将通过POST仅收到选中的单选框值

提交前是否选中了单选按钮?只有选中的按钮才会出现在“请求相同的复选框”中。请回答上述问题:您可以使用所选属性默认选中一个单选按钮。您是否选择了单选按钮?哈哈,我现在觉得自己像个白痴。也许我需要去睡觉了。谢谢你们,谢谢你们。我没有选择单选按钮就提交了。如果可以,我会投你一票。我很高兴能帮助你!我将等待你的声誉提高!:是的,谢谢你。我没有选择单选按钮就提交了。
 <input type="radio" name="custType" value="Bulk" selected>