#! /usr/bin/perl if ($ENV{'REQUEST_METHOD'} eq 'GET') { @pairs = split(/&/, $ENV{'QUERY_STRING'}); } elsif ($ENV{'REQUEST_METHOD'} eq 'POST') { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); } else { print "This script must be called from the Web\nusing either GET or POST requests\n\n"; } foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $name =~ tr/+/ /; $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ s/\n/
/g; $INPUT{$name} = $value; } print "Content-type:text/html\n\n"; $name="../ssi/top.txt"; &ssi; open(IN, "data.txt"); @indata=; close(IN); $cnt=0; $INPUT{'start'} = 0 if ($INPUT{'start'} eq ""); $end = $INPUT{'start'} + 500; print "
Mid-East Realities pictures
click to enlarge

"; $counter=0; foreach $line (@indata) { $counter++; } print "
showing: $INPUT{'start'} - $end ($counter total)
"; print "
Back to the start | Next 500 pictures


"; print ""; foreach $line (@indata) { ($num, $title, $info) = split(/\|/, $line); if ($cnt >= $INPUT{'start'}) { print ""; } $cnt++; print "" if (($cnt % 4) == 0); last if ($cnt eq $end); } print "
"; if (-e "small$num") { print "
\n"; } else { print "
\n"; } print "
$title
$info
\n"; print "
"; print "
Next 500 pictures
" if ($cnt == $end); print "

"; $name="../ssi/int.txt"; &ssi; $name="../ssi/articles.txt"; &ssi; $name="../ssi/bottom.txt"; &ssi; sub ssi { open(IN, "$name"); @indata = ; close(IN); foreach $line (@indata) { print $line; } }