php - REST call after query -
i have php page has query post database on button click starts query, works , database received data.
i want run rest call after query has run send of data website.
i getting no errors , in network tab, can see post 200 generated page query , rest call. not getting rest call on other site.
so query works, tried add code bellow @ end of query , within many places in query, how ever not working.
is correct way of doing ?
$data = array( 'userdid' => $_session[userid], 'score' => $percentile, 'assessmentid' => $_post['courseitemid'], 'assessmenttitle' => $_post['testname'] ); $data_string = json_encode($data); $ch = curl_init('https://ws.some.com/restexternal.svc/here'); curl_setopt($ch, curlopt_customrequest, "post"); curl_setopt($ch, curlopt_postfields, $data_string); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_httpheader, array( 'content-type: application/json', 'content-length: ' . strlen($data_string)) ); $result = curl_exec($ch);
above code added @ end of query .php page use same variables post call, dose not seem work.
Comments
Post a Comment