Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once("mainconfig.php");
- $postdata = "api_key=MASUKAN-API-KEY DISINI";
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, "https://serverh2h.net/service/pulsa");
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- $chresult = curl_exec($ch);
- echo $chresult;
- curl_close($ch);
- $json_result = json_decode($chresult, true);
- $indeks=0;
- while($indeks < count($json_result)){
- $id = $json_result[$indeks][id];
- $name = $json_result[$indeks][name];
- $status = $json_result[$indeks][status];
- $price = $json_result[$indeks][price];
- $oprator = $json_result[$indeks][oprator];
- $indeks++;
- $rate_asli = $price + 75; // SET untung ( mark up ) dari DPEDIA
- mysqli_query($db,"INSERT INTO services_pulsa(id, pid, name, oprator, price, status, provider) VALUES ('$id','$id','$name','$oprator','$rate_asli','$status','DPEDIA')");
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment