Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Php random code help?

  • 13-02-2011 10:08pm
    #1
    Registered Users Posts: 18


    I was wondering could anyone help me on this, The code below is to have a random youtube video played whenever the page is refreshed,i was wondering how you would be able to diplay random online games and photos? by using provided embed code

    <?php

    $videos = array(
    'mAh--lH0H3U',
    'ACyWliYFsXg',
    'As-Rulo-E4g',
    'aHU3s1pdacY',
    // Add more ids there list this:
    // 'id',
    );


    $video = $videos[rand(0, count($videos) - 1)];

    echo '<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/', $video, '&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/', $video, '&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>';
    ?>


Comments

Advertisement