Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ----------------------------------------------------------
- SCRIPT GET PRODUK PULSA DPEDIA
- Bagus Adetyo Nugroho < [email protected]
- Diamond Group
- ----------------------------------------------------------
- <?php
- require_once("mainconfig.php");
- $postdata = "api_key=APIKEYLO";
- $untung = "100"; // SET untung ( mark up ) dari DPEDIA
- $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]+ $untung;
- $oprator = $json_result[$indeks][oprator];
- $type = $json_result[$indeks][tipe];
- $indeks++;
- mysqli_query($db,"INSERT INTO services_pulsa (id, pid, name, oprator, tipe, price, status, keterangan, provider) VALUES ('$id', '$id', '$name', '$oprator', '$type', '$price', '$status', 'Masukan No HP dengan benar', 'DPEDIA')");
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment