Current location: Hot Scripts Forums » Programming Languages » PHP » PHP - Dir listing and write to file


PHP - Dir listing and write to file

Reply
  #1 (permalink)  
Old 08-23-03, 11:01 AM
NickyWhicko NickyWhicko is offline
New Member
 
Join Date: Aug 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
PHP - Dir listing and write to file

Hi there,

I'm having a bit of trouble with this !

I'm a flash actionscripter but need a bit of php to do this -

I need to know how to read all the files in a certain directory and then write the names to a textfile.

The main probs are, I need it to write to the file without the file extender, and I need the &'s in it so I can read it from flash?

textfile needs to be like this -

&product00=magrore&product01=sydney&product02=engl and&product03=paris&produc
t04=newyork&product05=cuba&fileloaded=1&

where magrore, sydney, england etc are the filenames less the *.jpg
extension

fileloaded is my swonking tag and the &'s are just how flash reads vars from
a textfile.

Any help would be immensly apprecitated -

CHeers
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 08-23-03, 01:15 PM
Kage Kage is offline
New Member
 
Join Date: Aug 2003
Location: Destination
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
How is the script going to be executed (manually, or by the flash)? Do you want the script to output any text (as in echo'd text, not what will be in the textfile), and how do you want them sorted (alphabetical, natural alphabetical, reverse, by name, by last modification time/date, ...)?
__________________
“A script is what you give the actors. A program is what you give the audience.”
~Larry Wall - Perl Creator
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 08-23-03, 03:11 PM
NickyWhicko NickyWhicko is offline
New Member
 
Join Date: Aug 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Hi there,

The script is executed manually on running it through the browser. It would be nice if it was sorted by date - I hadn't thought of that - nice touch Kage !!!!

cheers
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 08-24-03, 12:23 AM
Kage Kage is offline
New Member
 
Join Date: Aug 2003
Location: Destination
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
A thought occured to me.. Why not just have Flash execute the PHP file, and the PHP will output the data you want, which the Flash can retrieve, and it will always be up-to-date for whenever you add or remove images.
__________________
“A script is what you give the actors. A program is what you give the audience.”
~Larry Wall - Perl Creator
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 08-24-03, 03:42 AM
NickyWhicko NickyWhicko is offline
New Member
 
Join Date: Aug 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Okay - that sounds pretty good, but now it's a little over my head!!

What code do you have?

Thanks mate
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 06:39 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.