PHP analyzes the repeated POST values

Source: Internet
Author: User
Tags php server
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.