• 05-12-2022, 19:34:42
    #1
    <?php
    $videos = array();
    $videos[0] = “http://www.youtube.com/embed/XXXXXXXXXX”; 
    $videos[1] = “http://www.youtube.com/embed/XXXXXXXXXX”; 
    $videos[2] = “http://www.youtube.com/embed/XXXXXXXXXX”; 
    $videos[3] = “http://www.youtube.com/embed/XXXXXXXXXX”;
    
    $height = “315”; $width = “420”; $frameborder = “0”;
    // Should not need to edit below this line.
    $videosTotal = count($videos); $random = range(0, $videosTotal-1); shuffle($random); echo “<iframe width=’” . $width . “’ height=’” . $height . “’ src=’” . $videos[$random[0]] . “’ frameborder=’” . $frameborder . “’ allowfullscreen></iframe>”;
    ?>
    bu kodu kullandığım zaman sayfam beyaz ekrana düşüyor yardımcı olurmusunuz nasıl çözebilirim
  • 05-12-2022, 19:39:51
    #2
    Kodun tamamını bilmediğim için net birşey diyemiyorum fakat hata olmuş olsaydı çalışmazdı gördüğüm kadarasıyla bu kod zaten çalışmaz hocam çünkü çıktı vermemişsiniz echo ile çıktı almanız gerekiyor
  • 07-12-2022, 17:37:15
    #3
    Kullandığınız tırnaklarla ilgili bir hata sanırım. Bu şekilde dener misiniz?
    <?php
    $videos = array();
    $videos[0] = "http://www.youtube.com/embed/XXXXXXXXXX"; 
    $videos[1] = "http://www.youtube.com/embed/XXXXXXXXXX"; 
    $videos[2] = "http://www.youtube.com/embed/XXXXXXXXXX"; 
    $videos[3] = "http://www.youtube.com/embed/XXXXXXXXXX";
     
    $height = "315";
    $width = "420";
    $frameborder = "0";
    // Should not need to edit below this line.
    $videosTotal = count($videos); 
    $random = range(0, $videosTotal-1); 
    shuffle($random); 
    echo "<iframe width='" . $width . "' height='" . $height . "' src='" . $videos[$random[0]] . "' frameborder='" . $frameborder . "' allowfullscreen></iframe>";
    ?>