PHP analyzes POST duplicate client HTML
On the PHP Server, how does one determine whether the two groups of parts, transysno, and tranlineid are the same?
Reply to discussion (solution)
Php requires input of the same name variable writing array form
Therefore, only one group of controls with the same name in your form is received by php.
Php requires input of the same name variable writing array form
Therefore, only one group of controls with the same name in your form is received by php.
After writing an array, how can we analyze whether the values of the three variables in four variables are the same and then determine whether to merge their count?
After the submission, print_r ($ _ POST); knows how to do it.
Client html
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';}
Post see http://bbs.csdn.net/topics/360243533