21,886
社区成员
发帖
与我相关
我的任务
分享
<form action="new.php" method="post">
<input name="part" type="text" />
<input name="transysno" type="text" />
<input name="tranlineid" type="text" />
<input name="count" type="text" />
<input name="part" type="text" />
<input name="transysno" type="text" />
<input name="tranlineid" type="text" />
<input name="count" type="text" />
<input type="submit" name="post" value="提交" />
</form>
<form action="news.php" method="post">
<input name="part[]" type="text" />
<input name="transysno[]" type="text" />
<input name="tranlineid[]" type="text" />
<input name="count[]" type="text" />
<input name="part[]" type="text" />
<input name="transysno[]" type="text" />
<input name="tranlineid[]" type="text" />
<input name="count[]" type="text" />
<input type="submit" name="post" value="提交" />
</form>
news.php
if($_POST['part'][0]==$_POST['part'][1] && $_POST['transysno'][0]==$_POST['transysno'][1] && $_POST['tranlineid'][0]==$_POST['tranlineid'][1]){
echo ($_POST['count'][0] + $_POST['count'][1]);
}else{
echo 'part,transysno,tranlineid not match';
}