Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function fn_user_registered_test_update_profile($action, $user_data,
- $current_user_data){
- $encoded=json_encode($user_data);
- extract(json_decode($encoded, true));
- if($user_type == "C"){
- if ($action == "add"){
- $url = 'http://199.99.999.99:9999/api/users'; // url is different
- $data = array('email'=>$email,'name'=>$firstname,'type'=>'customer');
- $data_json = json_encode($data);
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-type: application/json"));
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $data_json);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- $result = curl_exec($ch);
- curl_close($ch);
- }
- }
Add Comment
Please, Sign In to add comment