1#!/usr/bin/perl 2 3require "common.pl"; 4 5print "Content-type: text/html\n\n"; 6print "<HTML>"; 7 8# get current and last shown picture id 9$sCurrPic = join( "", common::File_read( "currpic.txt" ) ); 10 11%aRequestMap = common::HTTP_getRequest(); 12$sLastPic = $aRequestMap{ "LastPic" }; 13 14print "<HEAD>"; 15 print "<META http-equiv=\"refresh\" CONTENT=\"" . $common::REFRESH_TIME . "; URL=poll.pl?LastPic=" . $sCurrPic . "\">"; 16print "</HEAD>"; 17 18#' a new picture was chosen ? 19if( $sLastPic ne $sCurrPic ) 20{ 21 # then show the new picture 22 print "<BODY bgcolor=\"red\" onLoad=\"parent.frame1.location.href='./show.pl?" . $sCurrPic . "'\">"; 23} 24else 25{ 26 # otherwise do nothing 27 print "<BODY bgcolor=\"green\">"; 28} 29 30print "</BODY>"; 31 32print "</HTML>";