无法将数据发送到另一个页面

时间:2016-04-15 03:27:49

标签: php html mysql

我想将隐藏数据和用户输入数据发送到另一个页面。首先,我尝试只输入一个用户输入,然后系统可以按照我想要的方式发送数据。

<h1><strong>Please scan barcode on JIG</strong></h1>
<table>
<form action="productjit21.php" method="post" name="check2"/>
<input type="hidden" name="productnumber" value="<?php echo $productnumber; ?>">
<tr><td>JIG Barcode</td><td>:</td><td><input type="text" name="jitcode2" maxlength="50"/></td></tr>
</table>

通过上面的代码,我可以发送用户和隐藏数据。但是,当我为用户输入添加新行时,它无法发送数据。

<h1><strong>Please scan barcode on JIG</strong></h1>
<table>
<form action="productjit21.php" method="post" name="check2"/>
<input type="hidden" name="productnumber" value="<?php echo $productnumber; ?>">
<tr><td>JIG Barcode</td><td>:</td><td><input type="text" name="jitcode1" maxlength="50"/></td></tr>
<tr><td>JIG Barcode</td><td>:</td><td><input type="text" name="jitcode2" maxlength="50"/></td></tr>
</table>

我没有创建提交按钮,因为我们想使用条形码扫描仪。我不认为提交按钮是问题,因为当我只创建一个用户输入时,系统可以在没有提交按钮的情况下运行。

1 个答案:

答案 0 :(得分:1)

不要立即关闭表单标签,而是尝试将输入包装在表单标签中,如此

<form action="productjit21.php" method="post" name="check2">
<input type="hidden" name="productnumber" value="<?php echo $productnumber; ?>">
<tr><td>JIG Barcode</td><td>:</td><td><input type="text" name="jitcode1" maxlength="50"/></td></tr>
<tr><td>JIG Barcode</td><td>:</td><td><input type="text" name="jitcode2" maxlength="50"/></td></tr>
</form>
相关问题