Başlayalım:
PHP Kod:
<?php
function tcno_dogrula($bilgiler){
$gonder = '<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<TCKimlikNoDogrula xmlns="http://tckimlik.nvi.gov.tr/WS">
<TCKimlikNo>'.$bilgiler["tcno"].'</TCKimlikNo>
<Ad>'.$bilgiler["isim"].'</Ad>
<Soyad>'.$bilgiler["soyisim"].'</Soyad>
<DogumYili>'.$bilgiler["dogumyili"].'</DogumYili>
</TCKimlikNoDogrula>
</soap:Body>
</soap:Envelope>';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://tckimlik.nvi.gov.tr/Service/KPSPublic.asmx" );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt($ch, CURLOPT_POST, true );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $gonder);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'POST /Service/KPSPublic.asmx HTTP/1.1',
'Host: tckimlik.nvi.gov.tr',
'Content-Type: text/xml; charset=utf-8',
'SOAPAction: "http://tckimlik.nvi.gov.tr/WS/TCKimlikNoDogrula"',
'Content-Length: '.strlen($gonder)
));
$gelen = curl_exec($ch);
curl_close($ch);
return strip_tags($gelen);
}
?>Tasarımı hazırlıyoruz (Ben tasarımı kendime göre ayarladım siz de kendinize göre ayarlayabilirsiniz.)
Bootstrap Kullanarak tasarımı oluşturdum oluşan görüntü şu şekilde:

Formu post metoduyla hazırladık verileri alıyoruz.
PHP Kod:
if($_POST){
$dcnick = $_POST['dcnick'];
$frnick = $_POST['frnick']; //Burası telefon numarası kısmı sizi şaşırtmasın
$bilgiler["tcno"] = $_POST["tc"];
$bilgiler["isim"] = $_POST["isim"];
$bilgiler["soyisim"] = $_POST["soyisim"];
$bilgiler["dogumyili"] = $_POST["yil"];
TC Kontrolünü yapıyoruz
PHP Kod:
$kontrol = tcno_dogrula($bilgiler);
if($kontrol=="true") { echo 'Onaylandı!';
İşimizi kolaylaştırması için webhook değişkenini atayalım.
PHP Kod:
$webhook = "WEBHOOK BURAYA";
Şimdi webhooku gönderelim:
PHP Kod:
$isim = $bilgiler["isim"];
$sisim = $bilgiler["soyisim"];
$make_json = json_encode(array ('content'=>"$isim $sisim TC Doğruladı || $frnick , $dcnick"));
$exec = curl_init("$webhook"); // $webhook
curl_setopt( $exec, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
curl_setopt( $exec, CURLOPT_POST, 1);
curl_setopt( $exec, CURLOPT_POSTFIELDS, $make_json);
curl_setopt( $exec, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt( $exec, CURLOPT_HEADER, 0);
curl_setopt( $exec, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec( $exec );
}
PHP Kod:
else{ echo 'TC Doğrulanamadı'; }
Discord Çıktısı

HTML kısmın kodlarını buraya yazmadım. Zaten bootstrap kullanarak hazırladığım için siz de kolayca hazırlayabilirsiniz.
DEMO | Websitem | İletişim
Takıldığınız noktada bana ulaşabilirsiniz. Scriptin amacı dışındaki kullanımlarında sorumluluk kabul edilmeyecektir!
Ve son olarak:
Bu içeriği görebilmek için kayıt olmanız gerekiyor!
)

