Guest User

Untitled

a guest
Jul 18th, 2018
335
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. $vst_hostname = 'dfsdfl.csfdsdsgds.com';
  2.  
  3. $postvars = array(
  4. $vst_username = 'zdeslogin',
  5. $vst_password = 'zdesparol',
  6. $vst_returncode = 'yes',
  7. $vst_command = 'v-add-user',
  8. $username = 'demo',
  9. $password = 'd3m0p4ssw0rd',
  10. $email = 'demo@gmail.com',
  11. $package = 'default',
  12. $fist_name = 'Rust',
  13. $last_name = 'Cohle'
  14. );
  15.  
  16. $postdata = http_build_query($postvars);
  17.  
  18. $curl = curl_init();
  19. curl_setopt($curl, CURLOPT_URL, 'https://' . $vst_hostname . ':8083/api/');
  20. curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  21. curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
  22. curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
  23. curl_setopt($curl, CURLOPT_POST, true);
  24. curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
  25. $answer = curl_exec($curl);
  26. // Check result
  27. if($answer == 0) {
  28. echo "User account has been successfuly createdn";
  29. } else {
  30. echo "Query returned error code: " .$answer. "n";
  31. }
Add Comment
Please, Sign In to add comment