diamondpedia

SCRIPT GET SERVICES PULSA DPEDIA

Jun 20th, 2019
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.96 KB | None | 0 0
  1. <?php
  2. require_once("mainconfig.php");
  3. $postdata = "api_key=MASUKAN-API-KEY DISINI";
  4.  
  5. $ch = curl_init();
  6. curl_setopt($ch, CURLOPT_URL, "https://serverh2h.net/service/pulsa");
  7. curl_setopt($ch, CURLOPT_POST, 1);
  8. curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
  9. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  10. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  11. $chresult = curl_exec($ch);
  12. echo $chresult;
  13. curl_close($ch);
  14. $json_result = json_decode($chresult, true);
  15. $indeks=0;
  16. while($indeks < count($json_result)){
  17. $id = $json_result[$indeks][id];
  18. $name = $json_result[$indeks][name];
  19. $status = $json_result[$indeks][status];
  20. $price = $json_result[$indeks][price];
  21. $oprator = $json_result[$indeks][oprator];
  22. $indeks++;
  23. $rate_asli = $price + 75;               // SET untung ( mark up ) dari DPEDIA
  24.  
  25.  
  26. mysqli_query($db,"INSERT INTO services_pulsa(id, pid, name, oprator, price, status, provider) VALUES ('$id','$id','$name','$oprator','$rate_asli','$status','DPEDIA')");
  27. }
  28.  
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment