2017-07-24 37 views
0

我的表單代碼如下。並添加ramram作爲隱藏輸入。我想在此添加我的訂單。在2checkout響應中無法獲取自定義參數

<form id="2checkout" action="https://sandbox.2checkout.com/checkout/purchase" method="post"> 
<input type="hidden" name="sid" value="901353720"/> 
<input type="hidden" name="mode" value="2CO"/> 
<input type="hidden" name="li_0_name" value="Test Product"/> 
<input type="hidden" name="li_0_price" value="0.01"/> 
<input type="hidden" name="ramram" value="512" /> 
<input type="submit" value="Click here if you are not redirected automatically" /> 
</form> 
<script type="text/javascript">document.getElementById('2checkout').submit();</script> 

,並得到迴應,我用下面的代碼

<?php 

$html = ''; 
foreach ($_POST as $k => $v) { 
    $html .= "$k => $v"; echo PHP_EOL; 
} 

file_put_contents('test.txt', $html); ?> 

回答

相關問題