php - Send data using curl -
trying send data server accepts data in following format verify_data=mer_id=xxx|mer_trnx_id=xxx| mer_trnx_amt=xxx
following lines do?
$datatopost="verify_data=mer_id=xxx|mer_trnx_id=xxx| mer_trnx_amt=xxx"; curl_setopt ($ch, curlopt_postfields,$datatopost);<br />
any appreciated,i new curl.
you can use article see how properly.
i used code on project of mine
$data="from=$from&to=$to&body=".urlencode($body)."&url=$url"; //$urlx contains url want post. $data contains data posting //$resp contains response. $process = curl_init($urlx); curl_setopt($process, curlopt_header, 0); curl_setopt($process, curlopt_postfields, $data); curl_setopt($process, curlopt_post, 1); curl_setopt($process, curlopt_returntransfer,1); curl_setopt($process,curlopt_connecttimeout,1); $resp = curl_exec($process); curl_close($process);
Comments
Post a Comment