same form data, different actions on two separate submit buttons

后端 未结 3 757
野性不改
野性不改 2021-01-06 16:03

I have what is essentially a shopping cart that needs to have two separate checkout options. The first of which takes the user away from the site, but form data must be post

3条回答
  •  失恋的感觉
    2021-01-06 16:27

    If I understand correctly, you have 2 submit buttons on the same page and both of them have the same form if that is so, this should do the trick.

    if(isset($_POST['name1'])) {
    //do stuff
    }
    
    if(isset($_POST['name2'])) {
    //do other stuff
    }
    

提交回复
热议问题