• 30-12-2019, 16:46:41
    #1
    Kimlik doğrulama veya yönetimden onay bekliyor.
    merhaba arkadaşlar birebin api sinden iddaa programını çekmek istedim ilk adım olarak denediğim kod aşağıda normalde çalışması gerekir ancak print_r ile yazdırınca ekrana hiç bir şey yazmıyor sebebi nedir?

    <?php
    $json = file_get_contents('https://www.birebin.com/api/game-program/GetBulletin/');
    $json_data = json_decode($json,true);
    
    print_r($json_data);
    
    ?>
  • 30-12-2019, 16:50:14
    #2
    Üyeliği durduruldu
    $url = "json url buraya";
    $json = getir($url);
    $json_data = json_decode($json,true);
    
    echo print_r($json_data);
    
    
    function getir($url){
    $ch = curl_init();
    $user_agent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; tr; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6';
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );
    curl_setopt($ch, CURLOPT_ENCODING, '');
    curl_setopt($ch,CURLOPT_USERAGENT,$user_agent);
    $result = curl_exec($ch);
    curl_close($ch);
    return $result;
    }
  • 30-12-2019, 16:54:42
    #3
    file_get_contents ile https üzerinden istek atmak için php.ini dosyasında düzenleme yapmanız gerekiyor. https://www.emrahyuksel.com.tr/file_...ttps-problemi/
  • 30-12-2019, 17:17:15
    #4
    Widex adlı üyeden alıntı: mesajı görüntüle
    $url = "json url buraya";
    $json = getir($url);
    $json_data = json_decode($json,true);
    
    echo print_r($json_data);
    
    
    function getir($url){
    $ch = curl_init();
    $user_agent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; tr; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6';
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );
    curl_setopt($ch, CURLOPT_ENCODING, '');
    curl_setopt($ch,CURLOPT_USERAGENT,$user_agent);
    $result = curl_exec($ch);
    curl_close($ch);
    return $result;
    }
    malesef değişen birşey olmadı hocam boş ekran geliyor

    PsdBul adlı üyeden alıntı: mesajı görüntüle
    file_get_contents ile https üzerinden istek atmak için php.ini dosyasında düzenleme yapmanız gerekiyor. https://www.emrahyuksel.com.tr/file_...ttps-problemi/


    hocam php.ini dediğiniz şekilde açık işin garibi https://api.iddaa.com.tr/SportsProgram/basic/1 bu apiye bağlanıyor buda https ama https://www.birebin.com/api/game-program/GetBulletin bunu açmıyor anlamış değilim
  • 30-12-2019, 17:32:37
    #5
    Üyeliği durduruldu
    verdigim sekilde calisiyor bu arada.
  • 30-12-2019, 17:39:38
    #6
    Widex adlı üyeden alıntı: mesajı görüntüle
    verdigim sekilde calisiyor bu arada.
    hocam deniyorum echo print_r($json_data) dersem ekrana 1 yazıyor print_r($json_data) dersem hiç birşey yazmıyor boş ekran geliyor
    <?php
    
    $url = "https://www.birebin.com/api/game-program/GetBulletin";
    $json = getir($url);
    $json_data = json_decode($json,true);
    
    print_r($json_data);
    
    function getir($url){
    $ch = curl_init();
    $user_agent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; tr; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6';
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );
    curl_setopt($ch, CURLOPT_ENCODING, '');
    curl_setopt($ch,CURLOPT_USERAGENT,$user_agent);
    $result = curl_exec($ch);
    curl_close($ch);
    return $result;
    }
    ?>
  • 30-12-2019, 17:54:14
    #7
    curl işlemlerinizde https bağlantısını kabul ederseniz geri veri donüşü olacaktır.
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
    Yalnız gelen veriler karmaşık karakterlerden oluşuyor. Aşağıdaki gibi;


    Ücretli destek almak isterseniz iletişim kurabilirsiniz.
  • 30-12-2019, 18:40:08
    #8
    Üyeliği durduruldu
    var_dump($json_data);

    ile alabilirsin sayfaya.

    ornek sayfa ciktisi

  • 30-12-2019, 20:07:11
    #9
    Widex adlı üyeden alıntı: mesajı görüntüle
    var_dump($json_data);

    ile alabilirsin sayfaya.

    ornek sayfa ciktisi

    o halde paylaşmadığın kodlar var NULL yazıyor bende 3 farklı local sunucuda denedim hepsinde NULL , yinede teşekkürler