Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    905
    Thanks
    23
    Thanked 5 Times in 5 Posts

    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

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Mex
    Posts
    122
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Posts
    905
    Thanks
    23
    Thanked 5 Times in 5 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •