help please…total newbie and lost
i have the following script that reads a folder on my server
converts it to a link
[php]<?PHP
$folder = “./”;
$handle = opendir($folder);
Making an array containing the files in the current directory:
while ($file = readdir($handle))
{
$files[] = $file;
}
closedir($handle);
#echo the files
foreach ($files as $file) {
echo “$file”."
";
}
?>[/php]
what i need is for this script to only list files with a flv extention
then when clicked change the following script that would be in a different div, iframe or new window
[code]
<!--
include flowplayer JavaScript file that does
Flash embedding and provides the Flowplayer API.
-->
<script type="text/javascript" src="flowplayer-3.2.6.min.js"></script>
<!-- some minimal styling, can be removed -->
<link rel="stylesheet" type="text/css" href="style.css">
<!-- page title -->
<title>Minimal Flowplayer setup</title>
<div id="page">
<p style="text-align: center">Frank and karen's website</p>
<!-- this A tag is where your Flowplayer will be placed. it can be anywhere -->
<a
href="http://98.15.160.45/movies/"+ $file"
style="display:block;width:520px;height:330px"
id="player">
</a>
<!-- this will install flowplayer inside previous A- tag. -->
<script>
flowplayer("player", "http://98.15.160.45/movies/flowplayer-3.2.7.swf");
</script>
<!--
after this line is purely informational stuff.
does not affect on Flowplayer functionality
-->
</div>
[/code]
if this cant be done please let me know