i am trying to learn php and made a video script nothing special
it list all the video files in a folder and allows you to pick the one you want to play
what i need to do is sort the files by date so that the newest video’s are displayed first
here is the scipt:
[php]<?php echo "<?xml version=\"1.0\" encoding=\"utf-8\"?".">"; ?>
surf video’s
surf
;
<?php
$path = "./moviefiles";
$showForm = 1;
if(isset($_POST['Submit'])) {
$showForm = 0;
?>
<-- --> <?php } if ($showForm == 1) { //using the opendir function $dir_handle = @opendir($path) or die("Unable to open $path"); echo ''; //running the while loop echo ''; while ($file = readdir($dir_handle)) { if($file!="." && $file!="..") echo '' . $file . ''; } echo ''; //closing the directory closedir($dir_handle); echo ''; echo ''; } ?></body>
</html>
[/php]any ideas