是否有其他方式提交带有值的表单在JavaScript,Ajax或jQuery旁边的页面重定向之后?仅限PHP?
例如,页面alpha.php
具有以下示例形式;
<form action="beta.php" method="post" id="signupForm" class="signupForm" >
<select name="payment" class="form-control" id="payment" required="required">
<option value="">Select Payment Method</option>
<option value="PayPal">PayPal</option>
<option value="WorldPay">WorldPay</option>
</select>
</form>
在提交上述表单后,需要beta.php
在服务器端验证后,重定向到PayPal
或WorldPay
取决于上述表单中选择的选项,
<?php if(it's PayPal) { ?>
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="seller@domain.com">
<input type="hidden" name="item_name" value="hat">
<input type="hidden" name="item_number" value="123">
<input type="hidden" name="amount" value="15.00">
<input type="hidden" name="email" value="jdoe@zyzzyu.com">
// How to Submit it With PHP?
</form>
<?php } else if (it's Worldpay) { ?>
<form action="https://secure-test.worldpay.com/wcc/purchase" name=BuyForm method=POST>
<input type="hidden" name="instId" value="211619">
<input type="hidden" name="cartId" value="WorldPay Test page">
<input type="hidden" name="desc" value="">
<input type="hidden" name="M_subject" value="WorldPay example">
<input type="hidden" name="testMode" value="100">
// How to Submit it With PHP?
</form>
<?php } ?>
有可能吗?