Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/86.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 从多个窗体获取值_Php_Html_Forms - Fatal编程技术网

Php 从多个窗体获取值

Php 从多个窗体获取值,php,html,forms,Php,Html,Forms,我想从多个表单将值输入数据库 这是表格 <td width="191"><div align="left"><strong>First Name</strong></div></td> <td width="336" colspan="2"><form id="form3" name="form3" method="post" action="Register.php">

我想从多个表单将值输入数据库

这是表格

 <td width="191"><div align="left"><strong>First Name</strong></div></td>
          <td width="336" colspan="2"><form id="form3" name="form3" method="post" action="Register.php">
            <label for="textfield2"></label>
            <input type="text" size="50px" name="fname" id="fname" />
            </form></td>
          </tr>
        <tr>
          <td><div align="left"><strong>Last Name</strong></div></td>
          <td colspan="2"><form id="form4" name="form4" method="post" action="Register.php">
            <label for="textfield3"></label>
            <input type="text" size="50px" name="lname" id="lname" />
            </form></td>
          </tr>
        <tr>
          <td><div align="left"><strong>User Name</strong></div></td>
          <td colspan="2"><form id="form5" name="form5" method="post" action="Register.php">
            <label for="textfield4"></label>
            <input type="text" size="50px" name="uname" id="uname" />
            </form></td>
          </tr>
        <tr>
          <td><div align="left"><strong>Password</strong></div></td>
          <td colspan="2"><form id="form6" name="form6" method="post" action="Register.php">
            <label for="textfield5"></label>
            <input type="password" size="50px" name="password" id="password" />
            </form></td>
          </tr>
PHP:

但是我收到一个错误,说找不到post[email]post[fname]

您有3个不同的

<form id="form3" name="form3" method="post"
操作页面被称为register.php,但其余表单都是空白的

要解决此问题,请删除所有标记,并将输入放入1中

另请注意:


在问这些基本问题之前,你需要更新你的HTML和PHP知识

。它们不再得到维护。看到了吗?相反,学习,并使用or-将帮助您决定哪一个。如果选择PDO,。为您指明正确的方向,则不能同时提交多个表单。您可以一次提交一份表格。您可能希望一个表单有多个输入,而不是多个表单各有一个输入。此外,请删除所有多余的空白并修复选项卡。一个更整洁、表达更清楚的问题更有可能得到回答。
<form id="form3" name="form3" method="post"
<form id="form4" name="form4" method="post" action="Register.php">