Hi, all.
I currently have this PHP code on my site to display all the videos I have in one folder (so I don't have to update the HTML every time I add or delete one):
But it has 2 problems:Code:<? $path = "/home/content/d/e/f/defensecenter/html/videos/student002"; $dir_handle = @opendir($path) or die("Unable to open $path"); while ($file = readdir($dir_handle)) { if($file == "." || $file == ".." || $file == "index.php" ) continue; echo "<div class='vidlink'><a href=\"$file\">$file</a></div>"; } closedir($dir_handle); ?>
1. It displays the .htaccess file which I have there for password protection (not a big deal, it opens to an error page, but I'd prefer it not show at all).
2. It doesn't put them in alphanumerical order, it seams to just spit them up randomly (though the files are in the same order every time I visit/refresh the page).
Any help would be appreciated. I know little to nothing about PHP, I got that code off the web.
I could also use a good video tutorial on beginning PHP. I tried Lynda.com and a couple others, but found them very confusing, and I'm not dense, I do OK with HTML and CSS, but I can't get my head around PHP from any tutorial I've found.
Thanks a lot!
-Geezer



Reply With Quote


Bookmarks