卷发不发送数据链接点
问题描述:
这里是我写卷发不发送数据链接点
$url='url to connect to link point';
$port = (port number);
$fields = array(
'storename'=>urlencode('storenumber'),
'cardnumber'=>urlencode($row['cnumber']),
'cmonth'=>urlencode($row['cmonth']),
'cyear'=>urlencode($row['cyear']),
'ctype'=>urlencode($row['ctype']),
'securitycode'=>urlencode($row['csecuritycode']),
'chargetotal'=>urlencode($row['camount']),
'customer_ip'=>urlencode($_SERVER['REMOTE_ADDR']),
'submit'=>urlencode('submit'),
'ponumber'=>urlencode('ponumber'),
'totalamount'=>urlencode($row['camount']),
'txntype'=>urlencode('sale'),
'txnmode'=>urlencode('live'),
'mode'=>urlencode('payonly'),
'txnmode'=>urlencode('live'),
'od'=>urlencode($row['id1']),
'osCsid'=>urlencode($_GET['osCAdminID'])
);
foreach($fields as $key=>$value)
{
$fields_string .= $key.'='.$value.'&';
}
rtrim($fields_string,'&');
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_POST,count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);
echo $fields_string;
$result = curl_exec($ch);
echo"$result";
答
试试这个
$url='url to connect to link point';
$port = (port number);
$fields = array(
'storename'=>urlencode('storenumber'),
'cardnumber'=>urlencode($row['cnumber']),
'cmonth'=>urlencode($row['cmonth']),
'cyear'=>urlencode($row['cyear']),
'ctype'=>urlencode($row['ctype']),
'securitycode'=>urlencode($row['csecuritycode']),
'chargetotal'=>urlencode($row['camount']),
'customer_ip'=>urlencode($_SERVER['REMOTE_ADDR']),
'submit'=>urlencode('submit'),
'ponumber'=>urlencode('ponumber'),
'totalamount'=>urlencode($row['camount']),
'txntype'=>urlencode('sale'),
'txnmode'=>urlencode('live'),
'mode'=>urlencode('payonly'),
'txnmode'=>urlencode('live'),
'od'=>urlencode($row['id1']),
'osCsid'=>urlencode($_GET['osCAdminID'])
);
//url-ify the data for the POST
foreach($fields as $key=>$value) { $fields_string []= $key.'='.$value; }
$fields_string=implode('&',$fields_string);
//open connection
$ch = curl_init();
//set the url, number of POST vars, POST data
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_POST,count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);
//execute post
$result = curl_exec($ch);
//close connection
curl_close($ch);
echo $result;
@hacodaddict公顷卷曲码这就是正确的伴侣 – 2010-09-04 05:11:51