Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> Reading Files And Folders
pbolduc
post Dec 26 2007, 02:04 AM
Post #1


Member - Active Contributor
Group Icon

Group: Members
Posts: 92
Joined: 15-December 04
From: New Mexico
Member No.: 1,759



I am in the process of writing a small content management system for my niche sites and need to be able to accomplish the following two items. Any assistance would be appreciated:

I have a directory that has nothing but sub directories in it and I need to be able to identify each directory name and return them in an option drop down selection menu which will be included in an identifying URL.

ALSO:

I am in need of a script that could be included on a returned page that will read the content of a table and identify various keywords within the content and place a hyperlink around the particular keyword with the corresponding destination URL contained within.

Any assistance in these areas would be greatly appreciated:

Thanks in advance,
pete
Go to the top of the page
 
+Quote Post
altimit
post Dec 31 2007, 06:48 PM
Post #2


Member [ Level 1 ]
Group Icon

Group: Members
Posts: 30
Joined: 31-December 07
Member No.: 27,267



Hi pbolduc,

PHP Directory and Filesystem Functions are your friends here. Have you considered looking at the PHP Manual for the relevant function already?

In particular, the Directory Function "opendir" allows you to specify the directory you wish to access, and after which using "readdir" to get the filename of each suceeding entry, in a loop. In order for your script to know whether the returned entry by readdir is a file or a directory, you may use the Filesystem Function "is_dir", which returns a boolean true if the passed parameter corresponds to a directory entry.

The PHP Manual entries for the functions I gave provide much sample code that will give you good insight on how to solve your problem; it should be very simple though as what you need is quite straightforward.

Good luck.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Friends Can't Start The Exe Files I Send :((5)
  2. Renaming collection of Pictures (files)!(15)
  3. How To Play *.rm Files With Media Player(13)
  4. Need Some Help/advice On How To Restore Lost Files(5)
  5. Playing Two Wav Files Simultaneously In C#(4)
  6. If You Have Some Private Files(17)
  7. Sharing Files In Windows Xp Home(15)
  8. How To Embed Swf Files In Joomla ?(9)
  9. Converting Flash Files To Gif(7)
  10. How To Hide Your Files In XP(18)
  11. Renaming Files (Using Excel Spreadsheet)(20)
  12. How To Copy File & Folders From Linux To Windows?.(12)
  13. Locking Folders Without An Application!(2)
  14. Creating Executable Jar Files(9)
  15. How To Transfer Files From One Computer To Another(16)
  1. Reading Xml Data(2)
  2. Get User Input From Vbscript For Batch Files(2)
  3. How Do I Chmod Files On Astahost ?(20)
  4. Switch Network Settings With Batch Files(18)
  5. Need Some Help/advice On Lost Files.(8)
  6. Uploading More Than 30 Files In Less Than 10 Clicks?(5)
  7. Help Me: Need To Transfer Files From Old Computer(18)
  8. VB.NET: Howto Add And Delete Files(8)
  9. Magic Quotes And $_files(3)
  10. Software To Concatenate Mp3 Files(8)
  11. DVD/CD-RW Combo Drive Help: Not Reading DVDs(13)
  12. Network Places: Alternative To Ftp On Windows(10)
  13. How I Can Delet Unempty Folders(10)
  14. Basic Forensics: Winhex(1)
  15. How Do I Create And Write To Files?(4)


 



- Lo-Fi Version Time is now: 10th October 2008 - 07:50 PM