home *** CD-ROM | disk | FTP | other *** search
/ Internet 1996 World Exposition / park.org.s3.amazonaws.com.7z / park.org.s3.amazonaws.com / Vote / index.cgi < prev    next >
Encoding:
Text File  |  2017-09-22  |  1.6 KB  |  54 lines

  1. #!/usr/local/bin/perl
  2.  
  3. $theme_file = "/cp/htdocs/Scripts/theme_dic_low.txt";
  4.  
  5. print "Content-type: text/html\n\n";
  6. print "<html><head><title>Vote for the Golden Medals</title></head>\n";
  7.  
  8. print "<frameset rows=\"30\%,\*\">\n";
  9. print "<frame src=\"themes.html\" name=\"themes\" noresize>\n";
  10.  
  11. print "<frameset cols=\"40%,*\">\n";
  12.  
  13. if ($#ARGV >= 0) {
  14.    $args = $ENV{'QUERY_STRING'};
  15.    print "<frame src=\"/cgi-bin/Vote/display_pavilions.pl?$args\" name=\"pavilions\" noresize>\n";
  16.    print "<frame src=\"/cgi-bin/Vote/display_votes.pl?$args\" name=\"votes\" noresize>\n";
  17. }
  18. else {
  19.    $flag = 0;
  20.    $referer = $ENV{'HTTP_REFERER'};
  21.    if ($referer =~ /^http:\/\/([^\/]*)\/Pavilions\/(.*)/) {
  22.       $theme = $2;
  23.       if( (!($theme eq "")) && (!($theme =~ /^Medal(.*)/)) ) {
  24.          while (($last = chop($theme)) ne '/') { }
  25.          $theme = $theme.$last;
  26.  
  27.          if (open(T_FILE, $theme_file)) {
  28.             while (<T_FILE>) {
  29.                if (/^([^#]*)#$theme#([^#]*)#(.*)/) {
  30.                   $theme = $1;
  31.                   $theme =~ tr/ /+/;
  32.                   $flag = 1;
  33.                }
  34.             }
  35.          }
  36.       }
  37.       close(T_FILE); 
  38.    }
  39.    if ($flag == 1) {
  40.       print "<frame src=\"/cgi-bin/Vote/display_pavilions.pl?$theme\" name=\"pavilions\" noresize>\n";
  41.       print "<frame src=\"/cgi-bin/Vote/display_votes.pl?$theme\" name=\"votes\" noresize>\n";
  42.    }
  43.    else {
  44.       print "<frame src=\"pavilions.html\" name=\"pavilions\" noresize>\n";
  45.       print "<frame src=\"votes.html\" name=\"votes\" noresize>\n";
  46.    }
  47. }
  48. print "</frameset>\n";
  49.  
  50. print "<noframes>\n";
  51. print "</noframes>\n";
  52. print "</frameset>\n";
  53. print "</html>\n";
  54.