home *** CD-ROM | disk | FTP | other *** search
/ Internet 1996 World Exposition / park.org.s3.amazonaws.com.7z / park.org.s3.amazonaws.com / cgi-bin / Japan / Theme.0105 / theme_add_mail.pl < prev    next >
Perl Script  |  2017-09-21  |  2KB  |  88 lines

  1. #!/usr/local/bin/perl
  2.  
  3. # theme_add_mail.pl
  4. # Comments construction program in Japan theme pavilion
  5. # kawauso@acs.dnp.co.jp
  6. # 95/12/27
  7. #
  8. # THIS CODE INCLUDES THESE LIBRARIES
  9. #
  10. #   cgi-lib.pl  Copyright 1994 Steven E. Brenner
  11. #
  12.  
  13. require 'cgi-lib.pl';
  14.  
  15. &ReadParse(*in);
  16.  
  17. print "Content-type: text/html\n\n";
  18. print "<html><head>\n";
  19. print "<title>result</title>";
  20. print "</head><body bgcolor=\"#ffffff\">\n";
  21.  
  22. #
  23. # Ñßí╝ÑδÑóÑ╔Ñ∞Ñ╣ñ≥─╔╡¡ñ╣ñδÑ╒ÑíÑñÑδñ╬░╠├╓ñ≥╞└ñδ
  24. #
  25. ########
  26. #### www.mediagalxy.co.jpÑ╞Ñ╣Ñ╚═╤ ═╫╜±ñ¡╩╤ñ¿
  27. ########
  28. $am_filename = "$ENV{'PATH_INFO'}";
  29. $am_filename =~ s/\///g;
  30. $am_mail_file = "/stage/htdocs/Japan/Theme/logs/theme_$am_filename.lst";
  31. $am_lock = "/stage/htdocs/Japan/Theme/logs/theme_$am_filename.lock";
  32.  
  33. #
  34. # Ñ│ÑßÑ≤Ñ╚ñ¼╢⌡ñ╩ñΘ╜¬╬╗
  35. #
  36. if (!$in{'address'}) {
  37.     &err("Sorry, your comment seems contains no data.\n");
  38. }
  39.  
  40. #
  41. # ñ└ñ∞ñ½ñ¼╜±ñ¡╣■ñ≤ñ╟ñññδ┤╓ñ╧┬╘ñ─
  42. # ñóñ▐ñΩ┬╘ñ─ñ╩ñΘ╜¬╬╗
  43. #
  44. for($count = 0; -f "$am_lock"; $count++) {
  45.     sleep(1);
  46.     &err("Sorry, another person is writing now.") if ($count > 5);
  47. }
  48.  
  49.  
  50. #
  51. # ÑφÑ├Ñ»Ñ╒ÑíÑñÑδñ╚─╔╡¡ñ╣ñδÑ╒ÑíÑñÑδñ≥│½ñ»
  52. open (LOCK, ">$am_lock") || &err("$ac_lock Can not open lock file");
  53. open (FILE, ">>$am_mail_file") || &err("Can not open list file");
  54. #
  55. # ─╔╡¡Ñ╒ÑíÑñÑδñ╦╜±ñ¡▓├ñ¿ñδ
  56. print FILE "$in{'address'}\n";
  57.  
  58. close(FILE);
  59. close(LOCK);
  60. unlink "$am_lock";
  61.  
  62. #
  63. # ┼╨╧┐╜¬╬╗▓Φ╠╠
  64. #
  65. print "<center><h3><p>ñóñΩñ¼ñ╚ñªñ┤ñ╢ñññ▐ñ╣íú\n";
  66. print "<br>ñóñ╩ñ┐ñ╬Ñßí╝ÑδÑóÑ╔Ñ∞Ñ╣ñ≥";
  67. print "ÑΩÑ╣Ñ╚ñ╦─╔▓├ñ╖ñ▐ñ╖ñ┐íú</p>\n";
  68. print "<p>Thank you!<br>Your mail address has added to list.";
  69. print "</a></p></h3></center>\n";
  70. print "</body><hr><address>theme pavilion \@IWE'96 JAPAN</address></html>\n";
  71. exit;
  72.  
  73.  
  74. #
  75. # Ñ¿ÑΘí╝ñ╬╛∞╣τ
  76. #
  77. sub err{
  78.     local($msg) = @_;
  79.     print "<p>$msg</p>\n";
  80.     close FILE;
  81.     close TMP;
  82.     unlink "$am_lock";
  83.     print "</BODY></HTML>\n";
  84.     exit;
  85. }
  86.