Guest User

Untitled

a guest
Jul 23rd, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. function fn_user_registered_test_update_profile($action, $user_data,
  2. $current_user_data){
  3.  
  4. $encoded=json_encode($user_data);
  5. extract(json_decode($encoded, true));
  6.  
  7. if($user_type == "C"){
  8.  
  9. if ($action == "add"){
  10.  
  11. $url = 'http://199.99.999.99:9999/api/users'; // url is different
  12. $data = array('email'=>$email,'name'=>$firstname,'type'=>'customer');
  13. $data_json = json_encode($data);
  14.  
  15. $ch = curl_init();
  16. curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-type: application/json"));
  17. curl_setopt($ch, CURLOPT_URL, $url);
  18. curl_setopt($ch, CURLOPT_POST, 1);
  19. curl_setopt($ch, CURLOPT_POSTFIELDS, $data_json);
  20. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  21.  
  22. $result = curl_exec($ch);
  23. curl_close($ch);
  24. }
  25. }
Add Comment
Please, Sign In to add comment