Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <?php
- // RANDOM VIDEO
- $dir = "webm";
- $dh = opendir($dir);
- while (false !== ($filename = readdir($dh))) {
- $files[] = $filename;
- }
- sort($files);
- $randomvideo = rand(2, sizeof($files)-1);
- ?>
- </head>
- <body>
- <div align="center">
- <h1>Random Video</h1>
- <h2>Current video: <a href=/webm/<?php echo($files[$randomvideo]); ?> > <?php echo($files[$randomvideo]); ?> </a></h2>
- <h3>Total videos: <a href=/webm/> <?php echo(sizeof($files)-2); ?> </a></h3>
- <video style="background-color: black;"width="80%" height="70%" controls autoplay>
- <source src="webm/<?php echo($files[$randomvideo]); ?>" type="video/webm">
- Your browser does not support the video tag.
- </video>
- <p></p>
- <form action="" method="post">
- <input type="submit" value="Random video!">
- <p></p>
- </br>
- </form>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement