How to post request without curl
Here is one of the example
<?php
$postdata = http_build_query(
array(
'call_status' => $call_status,
'talk_time' => $talktime,
'dialler_id' => $dialerid,
'current_time' => $current_time,
'lead_id' => $lead_id,
'call_type' => inbound,
'queue_wait' => $queuewait,
'disposition' => $disposition,
'phone_no' => $phone,
'call_id' => $call_id,
'call_check' => 1
)
);
$opts = array('http' =>
array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => $postdata
)
);
$context = stream_context_create($opts);
$result = file_get_contents('http://blog.eduguru.in/updateData', false, $context);
echo $result;
echo $postdata;
?>
Satya Prakash`
i have usedĀ file_get_contents().
The PHP manual has a niceĀ example here. This is just copy past from the manual:
$postdata = http_build_query( array( 'var1' => 'some content', 'var2' => 'doh' ) ); $opts = array('http' => array( 'method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => $postdata ) ); $context = stream_context_create($opts); $result = file_get_contents('http://example.com/submit.php', false, $context);Related