![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
Join Date: Jan 2005
Posts: 110
Rep Power: 4
![]() |
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 |
|
|
|
|
|
#2 |
|
Programming Guru
![]() ![]() |
__________________
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. |
|
|
|
|
|
#3 |
|
PFO Founder
![]() ![]() |
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. |
|
|
|
|
|
#4 |
|
Programming Guru
![]() ![]() ![]() |
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." |
|
|
|
|
|
#5 |
|
Professional Programmer
|
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.
|
|
|
|
|
|
#6 |
|
Programming Guru
![]() |
!== 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?
__________________
|
|
|
|
|
|
#7 |
|
Professional Programmer
|
if $fileName !== "."
I've used it and for some reason it worked better than != i forget why, i'll look into it. |
|
|
|
|
|
#8 |
|
Programming Guru
![]() ![]() ![]() |
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." |
|
|
|
|
|
#9 |
|
Professional Programmer
|
fine, don't take my advise..
![]() |
|
|
|
|
|
#10 |
|
Programming Guru
![]() ![]() ![]() |
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." |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|