2017-07-24 39 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); ?> 

回答

相关问题