标题 | PHP分析POST重复值解决办法 |
范文 | PHP分析POST重复值 客户端HTML <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> 怎么在PHP服务端判断 两组part,transysno,tranlineid 是否相同 ,如果相同则获取相同count的和 ------解决方案-------------------- 提交后 print_r($_POST); 就知道该怎么做了 ------解决方案-------------------- 客户端html <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'; } |
随便看 |
|
在线学习网范文大全提供好词好句、学习总结、工作总结、演讲稿等写作素材及范文模板,是学习及工作的有利工具。