Advertisement
Guest User

Untitled

a guest
Jun 20th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1.  
  2. // api data
  3. $api_link = $data_provider['link'];
  4. $api_key = $data_provider['api_key'];
  5. // end api data
  6.  
  7. if ($provider == "MANUAL") {
  8. $api_postdata = "";
  9. } else if ($provider == "PULSAMEDIA") {
  10. $api_postdata = "api_key=$api_key&action=order&service=$post_service&data=$post_link&quantity=$post_quantity";
  11. } else {
  12. die("System Error!");
  13. }
  14.  
  15. $ch = curl_init();
  16. curl_setopt($ch, CURLOPT_URL, $api_link);
  17. curl_setopt($ch, CURLOPT_POST, 1);
  18. curl_setopt($ch, CURLOPT_POSTFIELDS, $api_postdata);
  19. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  20. curl_setopt($ch, CURLOPT_HEADER, 0);
  21. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  22. $chresult = curl_exec($ch);
  23. curl_close($ch);
  24. $json_result = json_decode($chresult, true);
  25.  
  26.  
  27. if ($provider == "PULSAMEDIA" AND $json_result['status'] == false) {
  28. $msg_type = "error";
  29. $msg_content = "×</span></button><b>Gagal:</b> Server Maintenance (1).";
  30. } else {
  31. if ($provider == "PULSAMEDIA") {
  32. $poid = $json_result['data']['id'];
  33. } else if ($provider == "MANUAL") {
  34. $poid = $oid;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement