Jump to content

Select video via dropdown/option


ferdi9999

Recommended Posts

Hello all, I'm not sure if im correct here but i have the following problem. I want to have a video site where there are different amounts of video files. I want to have a drop down where the titels are automaticly added (according to the files in the folder). When you select a file name, i want then to play the file. Im using HTML5 video so for that i need to adjust the src code htrought the dropdown list. I have found a piece of code that will look through the folder to see the files and make a list out of it. But instead of a list i want to have a dropdown of it. Anny1 any ideas about it? Here is my code for the list of items in the folder:

<?php	if ($handle = opendir('video/')) {	while (false !== ($file = readdir($handle)))	{		if ($file != "." && $file != "..")		{			 $thelist .= '<LI><a href="'.$file.'">'.$file.'</a>';		}	}	closedir($handle);	}?><P>List of files:</p><UL><P><?=$thelist?></p></UL>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...