Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // function that gathers vars for the curl req
- echo json_encode($login);
- $ch = curl_init($Mid_url); //Init curl
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
- curl_setopt($ch, CURLOPT_POST, true);
- // curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // follow redirect to new housing page
- curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($login)); // concat ucid/pass
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // return results to stdout instead of echo
- $result = curl_exec($ch); // send the curl, return result (actually html page after redir)
- curl_close($ch);
- return $result;
- }
- /* get data from index.thml */
- // $data = json_decode($HTTP_RAW_POST_DATA);
- $ucid_POST = 'myusername';//$data->ucid;
- $pass_POST = 'mypassword';//$data->pass;
- /* get response from mid */
- $result = toMid($ucid_POST, $pass_POST);
- echo json_decode($result);
- // raw data I get in the terminal when I execute this php
- {"response":{"njitucid":"mysusername","njitsuccess":1,"dbucid":"myusername","dbsuccess":"0","debug":""}SUCCESS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement