I have a subdomain containing only graphics. I’d like the default page to dynamically generate a listing of all the files in its directory (clickable links), while not showing subdirectories or parents. I’m guessing that this will only be possible to run server side, and there’s already a cgi-bin directory available. The host site doesn’t really give much info on what types of scripts can & can’t be run, so it may be a bit hit & miss.
Any suggestions appreciated.
Alan
Added – Narrowing down the field, it appears that this site (not mine incidentally) will only support CGI scripts written in Perl, Tcl, C or C++. I have arranged a redirect from the default page, which finds the following sample script OK, but all I can manage is a 500 Internal Server Error – “The server encountered an internal error or misconfiguration and was unable to complete your request.” I believe I have set permissions appropriately, and the redirect itself appears to be working. My Perl prowess is marginally above zero.
#!/usr/bin/perl -w
opendir(DIR, "..");
@files = grep(/.JPG$/,readdir(DIR));
closedir(DIR);
foreach $file (@files) {
print "$filen";
}