|
|
|
|
![]() ![]() |
Jun 20 2005, 12:57 AM
Post
#1
|
|
|
Premium Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 156 Joined: 14-March 05 From: Washington, USA Member No.: 4,520 |
Hey, I'm really in a jam. Here's whats happening, I have to post over 350 streaming WMA files on a server. But it would be nice to not have to script it out in HTML. And I know that in PHP you can set a directory or folder and PHP will place all the files out there. Would somone show me a way to do that? and please note where I must insert filenames, folder, ect.... So, I have tons of files that I need to have on the page, but scrpiting it takes long.
Heres the page I'm working on: http://www.cbf-wa.org/sermons.php thanx so much |
|
|
|
Jun 21 2005, 01:30 AM
Post
#2
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 629 Joined: 26-February 05 Member No.: 3,995 |
Here's a little script that'll read the contents of the directory. Unfortunately, I can't figure out how it sorts, but that may just be a problem with my school's server:
CODE $dir1 = "**DIR**"; //replace **DIR** with the directory where the stuff is
$dir = opendir($dir1); //open directory while(false !== ($file1 = readdir($dir))) //as long as there are more files { if($file1 != "." && $file1 != "..") //so that it doesn't get parent directory and current directory. { $file = "$dir1/$file1"; //the file path echo "<a href=\"$file\">$file1</a><br />"; //print link to file } //endif } //endwhile |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 6th October 2008 - 09:41 PM |