Advertisement
fcodex

BIN lookup

Dec 9th, 2017
1,451
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.43 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Bin Checker [binov.net]
  4.  * @author  Achmad Fahri <[email protected]>
  5.  */
  6. class Bin {
  7.     public function Check($bin) {
  8.         $ch = curl_init();
  9.         curl_setopt($ch, CURLOPT_URL, "https://binov.net/");
  10.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  11.         curl_setopt($ch, CURLOPT_POSTFIELDS, "BIN=".$bin."&COUNTRY=1&BANK=1");
  12.         curl_setopt($ch, CURLOPT_POST, 1);
  13.         curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');
  14.  
  15.         $headers = array();
  16.         $headers[] = "Host: binov.net";
  17.         $headers[] = "User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0";
  18.         $headers[] = "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
  19.         $headers[] = "Accept-Language: en-US,en;q=0.5";
  20.         $headers[] = "Content-Type: application/x-www-form-urlencoded";
  21.         $headers[] = "Referer: https://binov.net/";
  22.         $headers[] = "Connection: keep-alive";
  23.         $headers[] = "Upgrade-Insecure-Requests: 1";
  24.         curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  25.  
  26.         $result = curl_exec($ch);
  27.         if (curl_errno($ch)) {
  28.             echo curl_error($ch);
  29.         } else {
  30.             $hasil = $this->GetStr($result, '<tr><td>'.$bin.'</td><td>', '</td></tr></table>');
  31.             $hasil = str_replace("</td><td>", " ", $hasil);
  32.             echo $hasil."\r\n";
  33.         }
  34.     }
  35.     public function GetStr($string, $start, $end) {
  36.       $str = explode($start, $string);
  37.       $str = explode($end, $str[1]);
  38.       return $str[0];
  39.     }
  40. }
  41.  
  42. $api = new Bin();
  43. $api->Check("440066");
  44. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement