Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Directory Function, - I need some help
nickmealey
post 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
Go to the top of the page
 
+Quote Post
beeseven
post 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
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Getting List Of Directories And Files Using Php(6)
  2. How To Use A Link To Call Function In Php?(8)
  3. Include File.php?id=something(13)
  4. How To Sort Files Of A Directory using Php(11)
  5. Directory Files Displaying(5)
  6. How To List Files In A Directory + Subdirectory And Then Use Them.(8)
  7. Regexp Function Preg_match_all()(0)
  8. Displaying Files Of A Directory(2)
  9. Changin My Phpnuke Directory...please Help(13)
  10. Display Random File In A Directory(9)
  11. Explode Function Help(1)
  12. Help Needed With Directory/file Listing Code Infinite Loop(5)
  13. How Good Is This Data Cleaning Function?(2)
  14. The Extract() Function(6)
  15. Error With Joomla Template(1)
  1. [php] Header Function(2)
  2. [php](simple) Using Functions To Combine Values In A Form(2)
  3. Reading Files From Directory To Array, And Using $_get To Get Them(2)
  4. Mail() Clone(5)
  5. The Best Zip Function(1)
  6. Unofficial Trap17 Hosted Members Directory(13)
  7. Php Explode Function Help(4)
  8. How To Check If Fsockopen Function Is Enabled?(2)
  9. Arrays Outside A Function(3)
  10. Php Ftp Upload Form(1)
  11. How To Display Images Of A Directory(4)
  12. Endif function?(6)
  13. PHP Function To Add Previous and Next Page Feature(5)


 



- Lo-Fi Version Time is now: 6th October 2008 - 09:41 PM