Soru & Cevap

Python Ve php json istek ...

27.09.2022 - 11:06

merhaba altta eklediğim ekran görüntüsündeki koda php siteden nasıl yanıt gönderebilirim ?

50 Görüntülenme

2 Cevap

Sitedeki sorulara cevap verebilmek için giriş yapın ya da üye olun.

Profile picture for user helixo
helixo
12.10.2022 - 10:23

$getJson = file_get_contents('https://siteismi.com/apikey/'.$key);
$jsonDec = json_decode(getJson, true);

if($jsonDec['status'] == true){
//true message
}else{
//false message
}

Profile picture for user hesaplapage
hesaplapage
27.09.2022 - 01:11

Öncelikle json kodunu okuyalım.

$lisansJSON = file_get_contents("JSON DOSYA URLSİ");
$lisansBilgi = json_decode($lisansJSON);

Daha sonra lisans kodununun doğruluğunu kontrol edelim.

$kontrolEt = $lisansBilgi->message; // buraya json dosyasından dönecek olan doğrulama mesajının verisini girin

if ($kontrolEt == "Lisans Kodunuz Doğru!") : 
   echo "Lisans başarıyla doğrulandı.";
else :
   echo "Lisans kodu geçersiz";
endif;