在过程中稍后将金额从文本输入链接到付款按钮字段

时间:2018-04-17 20:03:09

标签: php html

我在网站处理页面上输入了金额:

<input type="text" name="youhave" class="form-control" value="1" id="youhave" value="1"

然后我有一些付款按钮:

<form target="_blank" action="https://perfectmoney.is/api/step1.asp" 
method="POST">
<input type="hidden" name="PAYEE_ACCOUNT" value="U3492039">
<input type="hidden" name="PAYEE_NAME" value="Cryptonage">
<input type="hidden" name="PAYMENT_ID" value="Cryptonage">
<input type="text"   name="PAYMENT_AMOUNT" value="">               
<input type="hidden" name="PAYMENT_UNITS" value="USD">
<input type="hidden" name="STATUS_URL" 
value="http://127.0.0.1/cryptonage.net">
<input type="hidden" name="PAYMENT_URL" 
value="http://127.0.0.1/cryptonage.net">
<input type="hidden" name="PAYMENT_URL_METHOD" value="GET">
<input type="hidden" name="NOPAYMENT_URL" 
value="http://127.0.0.1/cryptonage.net">
<input type="hidden" name="NOPAYMENT_URL_METHOD" value="GET">
<input type="hidden" name="SUGGESTED_MEMO" value="">
<input type="hidden" name="BAGGAGE_FIELDS" value="">
<input type="submit" name="PAYMENT_METHOD" value="Pay with PerfectMoney">
</form>

如何更改它以便稍后当您单击第二部分中的付款按钮时,处理的第一部分中给出的金额将被处理为“PAYMENT_AMOUNT”,而无需在旁边的文本字段中再次键入金额按钮。非常感谢

1 个答案:

答案 0 :(得分:1)

在上一页中创建表单并在该表单的操作中传递上面提到的此页面的链接

Example(previous page where amount is entered):
<form target="_blank" action="https://perfectmoney.is/api/step1.asp" 
method="POST">
 <input type="text" name="amount" class="form-control" value="1" id="amount" value="1">

<input type="submit" name="submit">
</form>
Example(current page where amount is to be shown):
<form target="_blank" action="https://perfectmoney.is/api/step1.asp" 
method="POST">
<input type="hidden" name="PAYEE_ACCOUNT" value="U3492039">
<input type="hidden" name="PAYEE_NAME" value="Cryptonage">
<input type="hidden" name="PAYMENT_ID" value="Cryptonage">
<input type="text"   name="PAYMENT_AMOUNT" 
<?php
if(isset($_POST['submit'])){
$amt =mysqli_real_escape_string($conn, $_POST['amount']);
echo 'value="'.$amt.'" disabled>'
}else{
echo 'value="0" disabled>'
}         
?>      
<input type="hidden" name="PAYMENT_UNITS" value="USD">
<input type="hidden" name="STATUS_URL" 
value="http://127.0.0.1/cryptonage.net">
<input type="hidden" name="PAYMENT_URL" 
value="http://127.0.0.1/cryptonage.net">
<input type="hidden" name="PAYMENT_URL_METHOD" value="GET">
<input type="hidden" name="NOPAYMENT_URL" 
value="http://127.0.0.1/cryptonage.net">
<input type="hidden" name="NOPAYMENT_URL_METHOD" value="GET">
<input type="hidden" name="SUGGESTED_MEMO" value="">
<input type="hidden" name="BAGGAGE_FIELDS" value="">
<input type="submit" name="PAYMENT_METHOD" value="Pay with PerfectMoney">
</form>