#!/usr/local/bin/perl # nonpush.cgi - by David Efflandt - efflandt@xnet.com 9/11/95 [9/22/95] # # Displays series of images manually with form push buttons. # Images may be consecutively numbered/lettered or @list. # # This test script may not be totally optimized. # path/[file_prefix] or /full_path_from_root/[file_prefix] $path = 'img/file'; # Consecutive letter or number suffix if no @list $first = 'a'; $last = 'j'; # Image size in pixels (comment out if unknown) $height = 51; $width = 63; # Comment out (#) or empty @list when using the above @list = ( #$path.'1.gif', #$path.'2.gif', #$path.'3.gif', #'img/special.gif', ); # Make list from suffix if no @list unless (@list) { @list = ($first ..$last); foreach $file (@list) { $file = $path.$file.'.gif'; } } # Print out a content-type for HTTP/1.0 compatibility print "Content-type: text/html\n\n"; # Get the input read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); # Split the name-value pairs @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); # Un-Webify plus signs and %-encoding $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; # Uncomment for debugging purposes # print "Setting $name to $value

"; $FORM{$name} = $value; } # Current image from form (hidden) if ($FORM{'img'}) { $x = $FORM{'img'} } else { $x = 0; } # Do button press $x += 1 if ($FORM{'next'}); $x = 0 if ($x > $#list); $x -= 1 if ($FORM{'prev'}); $x = $#list if ($x < 0); $file = $list[$x]; # Print page with new current image (hidden image number) print "Slide Show\n"; print "

Manual Animation


\n"; print "
\n"; print "

\n"; print "

\n"; print ' '; print '
'; print "\nBurning down the house (manually)


\n"; print "If you cache images this will go quicker "; print "once you have been through it.

\n"; print ''; print 'My Home Page'; print "\n\n";