php curl post to site什么都不返回

时间:2015-02-06 18:46:45

标签: php ssl curl ssl-certificate

我想将一些数据发布到网址。这是我的代码:

<?php
// registering cookie files
$tmpfname = tempnam("/tmp", "FOO");
$handle = fopen($tmpfname, "w");
fwrite($handle, '');
fclose($handle);
// end registring

function posttoscript($url,$data)
{
global $tmpfname;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_COOKIEJAR, $tmpfname);
curl_setopt($ch, CURLOPT_COOKIEFILE, $tmpfname);
curl_setopt($ch, CURLOPT_REFERER, 'http://azericard.com/pay/index.php');
$response = curl_exec($ch);
return $response;
}

    $data['lang'] = 'az';
    $data['AMOUNT'] = '1';
    $data['CURRENCY'] = 'AZN';
    $data['ORDER'] = '0000659';
    $data['DESC'] = 'Payment for account number 338810194429';
    $data['MERCH_NAME'] = 'International Bank Of Azerbaijan';
    $data['MERCH_URL'] = 'http://www.ibar.az';
    $data['TERMINAL'] = '17200765606';
    $data['EMAIL'] = 'none';
    $data['TRTYPE'] = '0';
    $data['COUNTRY'] = 'AZ';
    $data['MERCH_GMT'] = '+4';
    $data['LANG'] = 'az';
    $data['PAYMENT_TEXT'] = '';
    $data['TIMESTAMP'] = '659695656';
    $data['NONCE'] = 'eiowfhefio';
    $data['BACKREF'] = 'http://ibabankpayment.3dsecure.az/Backref.php';
    $data['P_SIGN'] = '645d65dw6';
$url = 'https://mpi.3dsecure.az/cgi-bin/cgi_link';
$page = posttoscript($url,$data);
echo $page;
?>

但它什么也没有回报。通常它必须返回一个付款页面。 所以,当我尝试这个代码时,我什么都没得到修复它没有任何错误。

0 个答案:

没有答案