Go Back   CodingForums.com > :: Server side development > Perl/ CGI

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-01-2002, 11:06 PM   PM User | #1
sir pannels
Regular Coder

 
Join Date: Jun 2002
Posts: 905
Thanks: 23
Thanked 5 Times in 5 Posts
sir pannels is an unknown quantity at this point
locating and listing then linking files

hey there,
ok need a script that finds a dir .. the dir will be a variable from url like http://whwatver.com/cgi-bin/script.pl?dirname=whatever
and it opens that "whatever" dir and lists every.txt file in that dir and if you click one of the names of the txt files listed it is linked to the txt file...i havent got very far argh im stumped....

got a lil bit but not much luck...can anyone hep me?
heres what i got which aint much use hehe

parse_form();

$dirname =$FORM{dirname};

opendir(DIR,"$dirname");

$found='no';

while($list=<DIR>){

if ($list=~ m/$dirname/g){
$found='yes';
}
}
if ($found eq 'yes' ) {
print "list of files with <br> between\n";
}
else {
print "No resluts found for $name in our database sorry!\n";

argh any ideas?
thanks lot
sir p
sir pannels is offline   Reply With Quote
Old 07-02-2002, 04:43 AM   PM User | #2
Calilo
Regular Coder

 
Join Date: Jun 2002
Location: Mex
Posts: 122
Thanks: 0
Thanked 0 Times in 0 Posts
Calilo is an unknown quantity at this point
i dont get it , you could just get all the files in the dir, (if there is a dir) and then print the array contents, as links,

or am i geting the thing wrong?

and on you rlast script you got all th contents of a dir into an array

Calilo
Calilo is offline   Reply With Quote
Old 07-02-2002, 02:36 PM   PM User | #3
sir pannels
Regular Coder

 
Join Date: Jun 2002
Posts: 905
Thanks: 23
Thanked 5 Times in 5 Posts
sir pannels is an unknown quantity at this point
yeh sorry the script wrong.
your right calilo thats what im after.. so the dir should be found by the url
so if it was to get all files in a dir called "blah" which is located under another dir called "guitar" it would be like www.whatever.com/cgi-bin/myscript.pl?maindir=guitar&dir=blah
hmm does that make sense?
thanks dude
sir p
sir pannels is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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


All times are GMT +1. The time now is 06:39 AM.


Advertisement
Log in to turn off these ads.