Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 9th, 2005, 8:14 AM   #1
cloud-
Hobbyist Programmer
 
Join Date: Jan 2005
Posts: 110
Rep Power: 4 cloud- is on a distinguished road
php script to find and list files..

i would like a little php script where from when it loads it gets the
files from he dir "Scripts" and if the extension is *.mrc
i want it to list the files as links with a box below with scroll bars. (like a code box)
so when i click on the link for the file it will add all the text from the file into the box below

can any one help me or have a link please
^_^

thanks alot
cloud- is offline   Reply With Quote
Old Mar 9th, 2005, 8:36 AM   #2
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
www.php.net

or maybe try a search on google for php scripts.
__________________
Profanity is the one language that all programmers understand.

Check out my Blog <---updated Nov 30 2007!

Last edited by big_k105; Mar 9th, 2005 at 9:56 AM.
Pizentios is offline   Reply With Quote
Old Mar 9th, 2005, 10:05 AM   #3
big_k105
PFO Founder

 
big_k105's Avatar
 
Join Date: Mar 2004
Location: Fargo, ND
Posts: 1,623
Rep Power: 10 big_k105 is on a distinguished road
Send a message via AIM to big_k105 Send a message via MSN to big_k105 Send a message via Yahoo to big_k105
http://us4.php.net/function.opendir

i think this is the function and stuff you would use to do this good luck
__________________
BIG K aka Kyle
Programming Forums
Kyle K Online

Please do not PM or email me programming questions. Post them in the forums instead.
big_k105 is offline   Reply With Quote
Old Mar 9th, 2005, 10:17 AM   #4
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
What you are looking for is a little more restrictive than what I implemented at my site... but here is some code from an image PHP script I have... that will help you out a bit...

$imgDir = opendir(".");

while($imgName = readdir($imgDir)) {

  if (($imgName != ".") || ($imgName != ".."))
    print("<A HREF=\"$imgName\">$imgName</A><BR>\n");

  }
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Mar 9th, 2005, 8:55 PM   #5
Dizzutch
Professional Programmer
 
Dizzutch's Avatar
 
Join Date: Dec 2004
Location: Worcester, MA
Posts: 441
Rep Power: 4 Dizzutch is on a distinguished road
Send a message via ICQ to Dizzutch Send a message via AIM to Dizzutch Send a message via MSN to Dizzutch Send a message via Yahoo to Dizzutch
IR, php 5 supports !== which also tests for type, it's a nice extra check to make sure . and .. are not included, just a comment.
__________________
naked pictures of you | PFO F@H stats
Dizzutch is offline   Reply With Quote
Old Mar 9th, 2005, 9:09 PM   #6
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
!== is the not equal to strict evaluator, it makes sure that the boolean is evaluated without auto-cohersion, i'm confused... how is this used in the script?
__________________

tempest is offline   Reply With Quote
Old Mar 9th, 2005, 9:11 PM   #7
Dizzutch
Professional Programmer
 
Dizzutch's Avatar
 
Join Date: Dec 2004
Location: Worcester, MA
Posts: 441
Rep Power: 4 Dizzutch is on a distinguished road
Send a message via ICQ to Dizzutch Send a message via AIM to Dizzutch Send a message via MSN to Dizzutch Send a message via Yahoo to Dizzutch
if $fileName !== "."
I've used it and for some reason it worked better than != i forget why, i'll look into it.
__________________
naked pictures of you | PFO F@H stats
Dizzutch is offline   Reply With Quote
Old Mar 9th, 2005, 10:17 PM   #8
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
Diz, I have PHP 4.x
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Mar 10th, 2005, 8:35 AM   #9
Dizzutch
Professional Programmer
 
Dizzutch's Avatar
 
Join Date: Dec 2004
Location: Worcester, MA
Posts: 441
Rep Power: 4 Dizzutch is on a distinguished road
Send a message via ICQ to Dizzutch Send a message via AIM to Dizzutch Send a message via MSN to Dizzutch Send a message via Yahoo to Dizzutch
fine, don't take my advise..
__________________
naked pictures of you | PFO F@H stats
Dizzutch is offline   Reply With Quote
Old Mar 10th, 2005, 1:33 PM   #10
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
if it makes ya feel better I will be updating to 5 this weekend i'll change my script for ya then
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

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 On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:03 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC