#!/usr/bin/perl $progname="index.pl"; $dirpath=""; $linkcolor="#ffffff"; ## Here we write out the start info print "Content-type: text/html \n\n"; print "ImageList v.1 - By Isabella\n"; print ""; print "

Pics of bella
ll her again.

"; &findfiles; &parse_form; $piccnt=0; if ($FORM{currpic} ne "" & $FORM{currpic}ne $searchfiles[0]) { do { $piccnt++; } while ($searchfiles[$piccnt] ne $FORM{currpic}); print ""; } if ($piccnt!=0) { print "Previous"; } if ($piccnt!=$#searchfiles) { print " Next"; } print "
Go Directly to an image:
"; print "
$searchfiles[$piccnt]
"; print "

\n\n"; exit; ## Here we figure out what files we need to use sub findfiles { @searchfiles=glob "*.jpg *.JPG *.gif *.GIF *.bmp"; } ##this thing parses the form sub parse_form { # Get the input if($ENV{'REQUEST_METHOD'} eq "POST") { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); } else { $buffer="$ENV{'QUERY_STRING'}"; } # Split the name-value pairs @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $FORM{$name} = $value; } }