Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting();
- $inet = $_POST['inet'];
- $br = preg_split('/\n/',$inet);
- $count = count($br);
- foreach ($br as $inet) {
- $curl = curl_init();
- curl_setopt_array($curl, array(
- CURLOPT_URL => "https://apimytech.indihome.co.id/api/ukur-jaringan",
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_ENCODING => "",
- CURLOPT_MAXREDIRS => 10,
- CURLOPT_TIMEOUT => 30,
- CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
- CURLOPT_CUSTOMREQUEST => "POST",
- CURLOPT_PROXY => "220.247.170.82:3128",
- CURLOPT_POSTFIELDS => "guid=41d24611e138b978cd3368306b95a5dd&code=0&data=%7B%22orderid%22%3A%22".$inet."%22%7D",
- CURLOPT_HTTPHEADER => array(
- "authorization: Basic bXlpbmRpaG9tZTpwN2Qya0xYNGI0TkY1OFZNODR2Vw==",
- "cache-control: no-cache",
- "content-type: application/x-www-form-urlencoded",
- "postman-token: fe6d21cb-67de-1c25-75cc-1f1a403d371c"
- ),
- ));
- $response = curl_exec($curl);
- $err = curl_error($curl);
- curl_close($curl);
- if ($err) {
- echo "No inet : ".$inet;
- echo "cURL Error #:" . $err;
- echo "<br>";
- } else {
- $enc = json_decode($response, true);
- echo "No inet : ".$inet;
- echo "<br>";
- echo "Redaman ONU : ".$enc["data"]["onu_rx_pwr"];
- echo "<br>";
- echo "Redaman OLT : ".$enc["data"]["olt_rx_pwr"];
- echo "<br>";
- echo "<br>";
- ob_flush();
- flush();
- sleep(8);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment