只是想对我如何做到这一点有所指导;我有一个表格

<form method="POST" action="myform.php">
<input name="selecttype" type="radio" value="send1only" checked><input name="selecttype" type="radio" value="send1and2">
<input type="submit" value="Next">
</form>


我必须发布文件,例如myform.php和myform2.php。我正在尝试完成某些事情,如果选择了“ send1only”,则表单仅发布到myform.php。如果选择了“ send1and2”,该表单将同时发布到myform.php和myform2.php。

我将如何处理?基本上,我正在使用Paypal构建表单,因此可以让客户选择稍后(仅发送1)或现在(send1and2)处理付款,一个帖子不会是文件,它将成为Paypal链接,而其他则是获取信息我。

最佳答案

您不能发布两个操作,但是应该可以有条件地执行相同的处理,从而可以包含myform2.php的内容。

  <?php

  // contents of myform1.php
  if (isset($_POST["selecttype"]) && $_POST["selecttype"] == "send1and2"){
        // contents of myform2.php or
        include "myform2.php";
  }
  ?>

关于php - 形式:发布到多个 Action 还是基于输入的 Action ?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/17561468/

10-12 12:46
查看更多