Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <select size="30" onchange="changeUrl1(this); changeUrl2(this);">
- <?php
- $files = array();
- $dir = opendir('./video');
- while(false != ($file = readdir($dir))) {
- if(($file != ".") and ($file != "..") and ($file != "index.html")) {
- $files[] = $file;
- }
- }
- $nbr_capta=count($files);
- natsort($files);
- foreach($files as $file) {
- $file=addslashes($file);
- $file2=stripslashes(str_replace('.mp4','',$file));
- ?>
- <option value="<?=$file?>"><?=$file2?></option>
- <?php
- }
- ?>
- </select>
- <script type="text/javascript">
- function changeUrl1(selectObject) {
- var value = selectObject.value;
- document.getElementById('video').src='video/'+value;
- }
- function changeUrl2(selectObject) {
- var value = selectObject.value;
- document.getElementById('titre').innerHTML=value;
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement