1#!/usr/bin/perl 2 3require "common.pl"; 4 5print "Content-type: text/html\n\n"; 6 7# get current and next picture 8$sCurrPic = join( "", common::File_read( "currpic.txt" ) ); 9@aPictureArray = common::File_read( "picture.txt" ); 10 11# not last picture or wrong input ? 12if( abs( $sCurrPic ) > 0 ) 13{ 14 $nCurrPic = abs( $sCurrPic ); 15 $nPictureArrayLen = @aPictureArray; 16 if( $nCurrPic < $nPictureArrayLen ) 17 { 18 $sPictureName1 = ( split( ";", @aPictureArray[ $nCurrPic ] ) )[ 1 ]; 19 $sPictureName2 = ( split( ";", @aPictureArray[ $nCurrPic + 1 ] ) )[ 1 ]; 20 } 21 else 22 { 23 $sPictureName1 = ( split( ";", @aPictureArray[ $nCurrPic ] ) )[ 1 ]; 24 $sPictureName2 = $sPictureName1; 25 } 26} 27 28print "<HTML>"; 29 30print "<HEAD>"; 31 print "<TITLE>$$1</TITLE>"; 32print "</HEAD>"; 33 34print "<BODY bgcolor=\"white\">"; 35 print "<P ALIGN=CENTER><IMG src=\"" . $sPictureName1 . "\" width=$$4 height=$$5 border=0>"; 36 print "<P><IMG src=\"" . $sPictureName2 . "\" width=1 height=1 border=0>"; 37print "</BODY>"; 38 39print "</HTML>";