PHP implementation of the form multi-button submission action method _php skills

Source: Internet
Author: User
Tags php print

There are two submit buttons in the form, to achieve when clicking on the different submit button, two different processing process, where the implementation of the form multiple Button submission action method to share with you.

Using PHP to judge, a form two buttons, the button's Name property is set to the same, but the value is set to different, the form submitted, only need to judge the value submitted can be transferred to different processing process, this method is more reasonable, suitable for multiple buttons in a form.

Php method, the code is as follows:

<?php  
 echo "$sub <br>\n";  
 if ("s1" = = $sub)  
 {  
  ...  
 }  
 else if ("s2" = $sub)  
 {  
  ...  
 }  
 ? >  
  

The above is the PHP implementation of the form of multiple buttons to submit the action method, I hope to help you learn.

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.