home *** CD-ROM | disk | FTP | other *** search
/ Internet 1996 World Exposition / park.org.s3.amazonaws.com.7z / park.org.s3.amazonaws.com / Pavilions / BrainOpera / cgi-bin / stats.cgi < prev    next >
Text File  |  2017-09-21  |  1KB  |  70 lines

  1. #!/usr/local/bin/perl
  2.  
  3. # Script written by Ben Adida
  4. # This script redirects to the right Stat Page.
  5. # written on October 27th, 1995.
  6.  
  7.  
  8. require 'flush.pl';
  9.  
  10. $date_file="/users/benjamin/bin/date.txt";
  11. open(datefile,"$date_file");
  12. $date=<datefile>;
  13. close(datefile);
  14.  
  15. $date=~ m/^(\S*)\s(.*)$/;
  16. $month=$1;
  17. $day=$2;
  18.  
  19. $month_menu="
  20. <select name=\"month\">
  21. <option> Jan
  22. <option> Feb
  23. <option> Mar
  24. <option> Apr
  25. <option> May
  26. <option> Jun
  27. <option> Jul
  28. <option> Sep
  29. <option> Oct
  30. <option> Nov
  31. <option> Dec
  32. </select>";
  33.  
  34. $month_menu=~ s/<option> $month/<option selected> $month/;
  35.  
  36. $day_menu="<select name=\"day\">";
  37. for ($i=0;$i<32;$i++) {
  38.     if ($i==$day) {
  39.     $added_stuff="<option selected> $i";
  40.     } else {
  41.     $added_stuff="<option> $i";
  42.     }
  43.     $day_menu="$day_menu\n$added_stuff";
  44. }
  45. $day_menu="$day_menu\n</select>";
  46.  
  47. sub html_header { 
  48.     print "Content-type: text/html\n\n";
  49.     &flush(STDOUT);
  50.     }
  51.  
  52. &html_header;
  53. print "<HTML><HEAD><TITLE>Brain Opera Stats Pages</TITLE></HEAD>
  54. <BODY bgcolor=#ffffff>
  55. <center><h1>Brain Opera Web Server Statistics</h1>
  56. <hr width=40%><p>
  57. <h3>I'd like the Stats page for:</h3>
  58. <form method=get action=\"/cgi-bin/stats-return.cgi\">
  59. $month_menu
  60. $day_menu
  61. <p>
  62. <input type=submit value=\"Give me the Stats\"><p>
  63. <hr size=3><address>benjamin@media.mit.edu</address></body></html>";
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.