Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require("config.php");
- $ip_dpedia = "172.105.239.47";
- $ipv6_dpedia = '2400:8902::f03c:91ff:fe31:756';
- if( $_SERVER['REMOTE_ADDR'] == $ip_dpedia || $_SERVER['REMOTE_ADDR'] == $ipv6_dpedia ){
- $data_masuk = $_POST['content'];
- $json = json_decode($data_masuk,TRUE);
- $json['_ip'] = $_SERVER['REMOTE_ADDR'];
- file_put_contents('callback.txt', json_encode($json), FILE_APPEND);
- $oid = $json['oid'];
- $service = $json['service'];
- $price = $json['price'];
- $status = $json['status'];
- $date = $json['date'];
- $catatan = $json['catatan'];
- $sql = "UPDATE pembelian_pulsa SET status = '$status' , keterangan = '$catatan' WHERE oid = '$oid' AND provider = 'DPEDIA'";
- $ok = mysqli_query($conn,$sql);
- if ( $ok == TRUE){
- echo json_encode([
- "status" => "ok"
- ]);
- }else{
- echo json_encode([
- "status" => "fail"
- ]);
- }
- } else {
- echo json_encode([
- "status" => "!ok"
- ]);
- }
- if(isset($_POST['content'])) {
- $data = json_decode($_POST['content'], 1);
- $data['_ip'] = $_SERVER['REMOTE_ADDR'];
- file_put_contents('last_callback.json', json_encode($data));
- $data = null;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement