home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2002 October / VPR0210A.ISO / OPENOFFICE / f_0055 / poll.pl
Perl Script  |  2000-09-18  |  774b  |  32 lines

  1. #!/usr/bin/perl
  2.  
  3. require "common.pl";
  4.  
  5. print "Content-type: text/html\n\n";
  6. print "<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.  
  14. print "<HEAD>";
  15.     print "<META http-equiv=\"refresh\" CONTENT=\"" . $common::REFRESH_TIME . "; URL=poll.pl?LastPic=" . $sCurrPic . "\">";
  16. print "</HEAD>";
  17.  
  18. #' a new picture was chosen ?
  19. if( $sLastPic ne $sCurrPic )
  20. {
  21.     # then show the new picture
  22.     print "<BODY bgcolor=\"red\" onLoad=\"parent.frame1.location.href='./show.pl?" . $sCurrPic . "'\">";
  23. }
  24. else
  25. {
  26.     # otherwise do nothing
  27.     print "<BODY bgcolor=\"green\">";
  28. }
  29.  
  30. print "</BODY>";
  31.  
  32. print "</HTML>";