function verify($values){
$send = '?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>'.$values["TCKimlikNo"].'</TCKimlikNo>
<Ad>'.$values["Ad"].'</Ad>
<Soyad>'.$values["Soyad"].'</Soyad>
<DogumYili>'.$values["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, $send);
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($send)
));
$return = curl_exec($ch);
curl_close($ch);
return strip_tags($return);
} php tc doğrulama sorunu
3
●132
- 30-04-2020, 14:48:03Merhaba Bu functionu kullanarak Doğrulama yapmaya çalışıyorum fakat her girilen bilgiye yanlış diyor nerde hata yapmışım Yardımcı olurmusunuz
- 30-04-2020, 14:52:19Hocam kodu kontrol etmedim ama bu linkteki fonksiyonu kullana bilirsin. https://gist.github.com/saltun/439794ab032b7a894d91
- 30-04-2020, 14:53:41Hocam türkçe karakter hatası varmış çözdüm İhtiyacı olan arkadaşlarda bu function ile çözerek kullanabilirMinimalite adlı üyeden alıntı: mesajı görüntüle
function karakter_duzeltme($gelen){ $karakterler = array("ç","ğ","ı","i","ö","ş","ü"); $degistir = array("Ç","Ğ","I","İ","Ö","Ş","Ü"); return str_replace($karakterler, $degistir, $gelen); } - 30-04-2020, 15:00:10Türkçe karakter hatası mı ? LowerCase hatası gibi geldi deyusuf68700 adlı üyeden alıntı: mesajı görüntüle