查看文件: post_bill.php
大小: 2.65 KB
类型: application/octet-stream
<?php require_once('../Connections/BE2.php'); ?> <?php //$url = "https://example.com"; mysql_select_db($database_BE2, $BE2); $query_Rt2 = "SELECT * FROM billpost where bid=3 AND cpost='N' order by bid"; $Rt2 = mysql_query($query_Rt2, $BE2) or die(mysql_error()); $row_Rt2 = mysql_fetch_assoc($Rt2); $totalRows_Rt2 = mysql_num_rows($Rt2); // $url='https://invoice.paynow.com.tw/PayNowEInvoice.asmx'; // test $url='https://testinvoice.paynow.com.tw/PayNowEInvoice.asmx'; //$mem_cid='42656789'; //$mem_password='56789898'; $csyStr=''; //exit; $ar1=array('商家訂單編','買方統編','買方姓名','買方住址','買方手機','買方EMAIL','載具類型','載具明碼','載具隱碼','愛心碼','明細描述','數量','單價','小計','備註','發票明細稅','是否經海關'); $ar2=array('orderno','buyer_id','buyer_name','buyer_add','buyer_phone','buyer_email','CarrierType','CarrierID_1', 'CarrierID_2','LoveCode','Description','Quantity','UnitPrice','Amount','Remark','ItemTaxtype','IsPassCustoms'); //,'IsPassCustoms' //for ($i=0;$i<count($ar1);$i++){ // echo $ar1[$i].",".$ar2[$i]."<br>"; // } $l=count($ar2); do { for ($i=0;$i<$l;$i++){ $csyStr .="’".$row_Rt2[$ar2[$i]]; if($i<>$l-1){ $csyStr .=","; } } $csyStr .= chr(10); } while ($row_Rt2 = mysql_fetch_assoc($Rt2)); echo $csyStr; // $post_value= 'mem_cid=42656789&mem_password=56789898&csyStr='.$csyStr; // $post_value= array("mem_cid"=>"42656789", "mem_password"=>"5678989","csyStr"=>$csyStr ); //'mem_cid='.$mem_cid.'&mem_password='.$mem_password.'&csyStr='.$csyStr; $b64= base64_encode($csyStr); $fields = array( 'mem_cid'=>'42656789','mem_password'=>'5678989' ,'csyStr'=> $b64 ); // 'csyStr'=> $csyStr $pstr="mem_cid=42656789&mem_password=5678989&csyStr=".$b64; $url='https://testinvoice.paynow.com.tw/PayNowEInvoice.asmx'; echo $b64; // $url='https://q.yuxingo.com.tw/billtest/posttest.php'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); //curl_setopt($ch, CURLOPT_POSTFIELDS,$pstr );//&csyStr=".$csyStr curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($fields) );//&csyStr=".$csyStr // curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: multipart/form-data')); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded')); $result = curl_exec($ch); curl_close($ch); print_r($result); ?>
保存
取消
返回文件列表