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

  1. #!/usr/bin/perl
  2.  
  3. # Guestbook for the World Wide Web
  4. # Created by Matt Wright           Version 2.3.1
  5. # Created on: 4/21/95      Last Modified: 10/29/95
  6.  
  7.  
  8. #############################################################################
  9. # Set Variables
  10.  
  11. $guestbookurl = "http://park.org/Tools/Guestbook/guestbook.html";
  12. $guestbookreal = "/web/fair/Tools/Guestbook/guestbook.html";
  13. $guestlog = "/web/fair/Tools/Guestbook/guestlog.html";
  14. $cgiurl = "http://park.org/cgi-bin/guestbook.pl";
  15. $date_command = "/bin/date";
  16.  
  17. # Set Your Options:
  18. $mail = 0;              # 1 = Yes; 0 = No
  19. $uselog = 1;            # 1 = Yes; 0 = No
  20. $linkmail = 1;          # 1 = Yes; 0 = No
  21. $separator = 1;         # 1 = <hr>; 0 = <p>
  22. $redirection = 0;       # 1 = Yes; 0 = No
  23. $entry_order = 1;       # 1 = Newest entries added first;
  24.                         # 0 = Newest Entries added last.
  25. $remote_mail = 0;       # 1 = Yes; 0 = No
  26. $allow_html = 1;        # 1 = Yes; 0 = No
  27. $line_breaks = 0;    # 1 = Yes; 0 = No
  28.  
  29. # If you answered 1 to $mail or $remote_mail you will need to fill out 
  30. # these variables below:
  31. $mailprog = '/usr/lib/sendmail';
  32. $recipient = 'webmaster@park.org';
  33.  
  34. # lock file name - bjb, 02-jan-1996
  35. local($lockfile) = "/tmp/guestbook.lock";
  36.  
  37. # Done
  38. #############################################################################
  39.  
  40.  
  41. # Get the Date for Entry
  42. $date = `$date_command +"%A, %B %d, %Y at %T (%Z)"`; chop($date);
  43. $shortdate = `$date_command +"%D %T %Z"`; chop($shortdate);
  44.  
  45. # Get the input
  46. read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
  47.  
  48. # Split the name-value pairs
  49. @pairs = split(/&/, $buffer);
  50.  
  51. foreach $pair (@pairs) {
  52.    ($name, $value) = split(/=/, $pair);
  53.  
  54.    # Un-Webify plus signs and %-encoding
  55.    $value =~ tr/+/ /;
  56.    $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
  57.    $value =~ s/<!--(.|\n)*-->//g;
  58.  
  59.    if ($allow_html != 1) {
  60.       $value =~ s/<([^>]|\n)*>//g;
  61.    }
  62.  
  63.    $FORM{$name} = $value;
  64. }
  65.  
  66. # Print the Blank Response Subroutines
  67. &no_comments unless $FORM{'comments'};
  68. &no_name unless $FORM{'realname'};
  69.  
  70. # attempt to lock guestbook access
  71. if (&lockFile == 1) {
  72.     # lock failed
  73.     &lock_failed;
  74.     exit 0;
  75. }
  76.  
  77. # Begin the Editing of the Guestbook File
  78. open (FILE,"$guestbookreal") || die "Can't Open $guestbookreal: $!\n";
  79. @LINES=<FILE>;
  80. close(FILE);
  81. $SIZE=@LINES;
  82.  
  83. # Open Link File to Output
  84. open (GUEST,">$guestbookreal") || die "Can't Open $guestbookreal: $!\n";
  85.  
  86. for ($i=0;$i<=$SIZE;$i++) {
  87.    $_=$LINES[$i];
  88.    if (/<!--begin-->/) { 
  89.  
  90.       if ($entry_order eq '1') {
  91.          print GUEST "<!--begin-->\n";
  92.       }
  93.    
  94.       if ($line_breaks == 1) {
  95.          $FORM{'comments'} =~ s/\cM\n/<br>\n/g;
  96.       }
  97.  
  98.       print GUEST "$FORM{'comments'}<br>\n";
  99.  
  100.       if ($FORM{'url'}) {
  101.          print GUEST "<p><a href=\"$FORM{'url'}\"> $FORM{'realname'}</a>";
  102.       }
  103.       else {
  104.          print GUEST "<p>$FORM{'realname'}";
  105.       }
  106.  
  107.       if ( $FORM{'username'} ){
  108.          if ($linkmail eq '1') {
  109.             print GUEST " <a href=\"mailto:$FORM{'username'}\">";
  110.             print GUEST "\($FORM{'username'}\)</a>";
  111.          }
  112.          else {
  113.             print GUEST " $FORM{'username'}";
  114.          }
  115.       }
  116.  
  117.       print GUEST "<br>\n";
  118.  
  119.       if ( $FORM{'city'} ){
  120.          print GUEST "$FORM{'city'},";
  121.       }
  122.      
  123.       if ( $FORM{'state'} ){
  124.          print GUEST " $FORM{'state'}";
  125.       }
  126.  
  127.       if ( $FORM{'country'} ){
  128.          print GUEST " $FORM{'country'}";
  129.       }
  130.  
  131.       if ($separator eq '1') {
  132.          print GUEST "<br>\n$date<hr align=left width=400>\n\n<!--New Entry-->\n<p>\n";
  133.       }
  134.       else {
  135.          print GUEST "<br>\n$date<hr align=left width=400>\n\n<!--New Entry-->\n<p>\n";
  136.       }
  137.  
  138.       if ($entry_order eq '0') {
  139.          print GUEST "<!--begin-->\n";
  140.       }
  141.  
  142.    }
  143.    else {
  144.       print GUEST $_;
  145.    }
  146. }
  147.  
  148. close (GUEST);
  149.  
  150. # unlock guestbook access
  151. &unlockFile;
  152.  
  153. # Log The Entry
  154.  
  155. if ($uselog eq '1') {
  156.    &log('entry');
  157. }
  158.  
  159.  
  160. #########
  161. # Options
  162.  
  163. # Mail Option
  164. if ($mail eq '1') {
  165.    open (MAIL, "|$mailprog $recipient") || die "Can't open $mailprog!\n";
  166.  
  167.    print MAIL "Reply-to: $FORM{'username'} ($FORM{'realname'})\n";
  168.    print MAIL "From: $FORM{'username'} ($FORM{'realname'})\n";
  169.    print MAIL "Subject: Entry to Guestbook\n\n";
  170.    print MAIL "You have a new entry in your guestbook:\n\n";
  171.    print MAIL "------------------------------------------------------\n";
  172.    print MAIL "$FORM{'comments'}\n";
  173.    print MAIL "$FORM{'realname'}";
  174.  
  175.    if ( $FORM{'username'} ){
  176.       print MAIL " <$FORM{'username'}>";
  177.    }
  178.  
  179.    print MAIL "\n";
  180.  
  181.    if ( $FORM{'city'} ){
  182.       print MAIL "$FORM{'city'},";
  183.    }
  184.  
  185.    if ( $FORM{'state'} ){
  186.       print MAIL " $FORM{'state'}";
  187.    }
  188.  
  189.    if ( $FORM{'country'} ){
  190.       print MAIL " $FORM{'country'}";
  191.    }
  192.  
  193.    print MAIL " - $date\n";
  194.    print MAIL "------------------------------------------------------\n";
  195.  
  196.    close (MAIL);
  197. }
  198.  
  199. if ($remote_mail eq '1' && $FORM{'username'}) {
  200.    open (MAIL, "|$mailprog -t") || die "Can't open $mailprog!\n";
  201.  
  202.    print MAIL "To: $FORM{'username'}\n";
  203.    print MAIL "From: $recipient\n";
  204.    print MAIL "Subject: Entry to Guestbook\n\n";
  205.    print MAIL "Thank you for adding to my guestbook.\n\n";
  206.    print MAIL "------------------------------------------------------\n";
  207.    print MAIL "$FORM{'comments'}\n";
  208.    print MAIL "$FORM{'realname'}";
  209.  
  210.    if ( $FORM{'username'} ){
  211.       print MAIL " <$FORM{'username'}>";
  212.    }
  213.  
  214.    print MAIL "\n";
  215.  
  216.    if ( $FORM{'city'} ){
  217.       print MAIL "$FORM{'city'},";
  218.    }
  219.  
  220.    if ( $FORM{'state'} ){
  221.       print MAIL " $FORM{'state'}";
  222.    }
  223.  
  224.    if ( $FORM{'country'} ){
  225.      print MAIL " $FORM{'country'}";
  226.    }
  227.  
  228.    print MAIL " - $date\n";
  229.    print MAIL "------------------------------------------------------\n";
  230.  
  231.    close (MAIL);
  232. }
  233.  
  234. # Print Out Initial Output Location Heading
  235. if ($redirection eq '1') {
  236.    print "Location: $guestbookurl\n\n";
  237. }
  238. else { 
  239.    &no_redirection;
  240. }
  241.  
  242. #######################
  243. # Subroutines
  244.  
  245. sub no_comments {
  246.    print "Content-type: text/html\n\n";
  247.  
  248. print "<HTML><HEAD><TITLE>\n";
  249. print "No Comments\n";
  250. print "</TITLE></HEAD>\n";
  251. print "\n";
  252. print "\n";
  253. print "<BODY BGCOLOR=\"#FFFFFF\" background=\"/Images/expo_hbk_01.gif\" TEXT=\"#000000\" LINK=\"#97694F\" VLINK=\"#42426f\">\n";
  254. print "\n";
  255. print "<a href=\"/cgi-bin/imagemap/Images/htoolbar.map\">\n";
  256. print "<img align=\"left\" width=\"486\" height=\"101\" \n";
  257. print "SRC=\"/Images/htoolbar.gif\" ISMAP border=\"0\"></a>\n";
  258. print "<br clear=\"all\">\n";
  259. print "\n";
  260. print "<table width=\"500\" height=\"0\"  border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
  261. print "    <tr>\n";
  262. print "        <td align=\"left\" valign=\"top\" height=\"26\" colspan=\"2\">\n";
  263. print "    </td></tr>\n";
  264. print "<tr>\n";
  265. print "<td align=\"left\" valign=\"top\" width=\"100\"></td>\n";
  266. print "\n";
  267. print "<td align=\"left\" valign=\"top\" width=\"400\">\n";
  268. print "\n";
  269. print "<p>\n";
  270. print "<font size=\"+2\"><b>Your <i>Comments</i> Are Blank</font size=\"+2\"></b>\n";
  271. print "\n";
  272. print "<p>\n";
  273. print "You did not fill out the comments section.  Due to an\n";
  274. print "<a href=\"http://town.hall.org/Archives/radio/IMS/SoundBytes/021594_byte_01_IMS.au\">arbitrary rule,<\/a>\n"; 
  275. print "we won\'t add your guestbook inscription without\n";
  276. print "a comment filled in.\n";
  277. print "Would you mind trying again?\n";
  278. print "\n";
  279. print "\n";
  280. print "<p>\n";
  281. print "<form method=POST action=\"$cgiurl\">\n";
  282. print "\n";
  283. print "<input value=\"$FORM{'realname'}\" type=\"text\" name=\"realname\" size=\"40\"> Your Name<br>\n";
  284. print "<input type=\"text\" value=\"$FORM{'username'}\" name=\"username\" size=\"40\"> E-mail<br>\n";
  285. print "<input type=\"text\" name=\"url\" value=\"$FORM{'url'}\" size=\"40\"> Your URL<br>\n";
  286. print "\n";
  287. print "<p>\n";
  288. print "<table width=\"400\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
  289. print "\n";
  290. print "<tr>\n";
  291. print "    <td align=\"left\">\n";
  292. print "    <input type=\"text\" name=\"city\" value=\"$FORM{'city'}\" size=\"15\"><br>City</td>\n";
  293. print "    <td align=\"left\">\n";
  294. print "    <input type=\"text\" name=\"state\" value=\"$FORM{'state'}\" size=\"15\"><br>State</td>\n";
  295. print "    <td align=\"left\">\n";
  296. print "    <input type=\"text\" name=\"country\" value=\"$FORM{'country'}\" size=\"10\"><br>Country</td>\n";
  297. print "\n";
  298. print "</tr></table>\n";
  299. print "\n";
  300. print "<p>\n";
  301. print "Comments:<br>\n";
  302. print "<textarea name=\"comments\" COLS=\"60\" ROWS=\"4\"></textarea><p>\n";
  303. print "\n";
  304. print "<table width=\"400\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
  305. print "<tr>\n";
  306. print "    <td align=\"left\">\n";
  307. print "    <input value=\"Reinscribe Guestbook\" type=\"submit\"></td>\n";
  308. print "    <td align=\"left\">\n";
  309. print "    <input value=\"Reset Form\" type=\"reset\"></td>\n";
  310. print "</tr></table>\n";
  311. print "\n";
  312. print "    </form>\n";
  313. print "\n";
  314. print "    </td>\n";
  315. print "    </tr>\n";
  316. print "</table>\n";
  317. print "  </body>\n";
  318. print "</html>\n";
  319.  
  320.  
  321.    # Log The Error
  322.    if ($uselog eq '1') {
  323.       &log('no_comments');
  324.    }
  325.  
  326.    exit;
  327. }
  328.  
  329. sub no_name {
  330.    print "Content-type: text/html\n\n";
  331.    print "<html><head><title>No Name</title></head>\n";
  332.  
  333.  
  334. print "\n";
  335. print "\n";
  336. print "<BODY BGCOLOR=\"#FFFFFF\" background=\"/Images/expo_hbk_01.gif\" TEXT=\"#000000\" LINK=\"#97694F\" VLINK=\"#42426f\">\n";
  337. print "\n";
  338. print "<a href=\"/cgi-bin/imagemap/Images/htoolbar.map\">\n";
  339. print "<img align=\"left\" width=\"486\" height=\"101\" \n";
  340. print "SRC=\"/Images/htoolbar.gif\" ISMAP border=\"0\"></a>\n";
  341. print "<br clear=\"all\">\n";
  342. print "\n";
  343. print "<table width=\"500\" height=\"0\"  border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
  344. print "    <tr>\n";
  345. print "        <td align=\"left\" valign=\"top\" height=\"26\" colspan=\"2\">\n";
  346. print "    </td></tr>\n";
  347. print "<tr>\n";
  348. print "<td align=\"left\" valign=\"top\" width=\"100\"></td>\n";
  349. print "\n";
  350. print "<td align=\"left\" valign=\"top\" width=\"400\">\n";
  351. print "\n";
  352. print "<p>\n";
  353. print "<font size=\"+2\"><b>Your <i>Name</i> Was Blank</font size=\"+2\"></b>\n";
  354. print "\n";
  355. print "<p>\n";
  356. print "You did not fill out your name.  Due to an\n";
  357. print "<a href=\"http://town.hall.org/Archives/radio/IMS/SoundBytes/021594_byte_01_IMS.au\">arbitrary rule,</a>\n"; 
  358. print "we will not add your guestbook inscription without\n";
  359. print "a comment filled in.\n";
  360. print "Would you mind trying again?\n";
  361. print "\n";
  362. print "\n";
  363. print "<p>\n";
  364. print "<form method=POST action=\"$cgiurl\">\n";
  365. print "\n";
  366. print "<input type=\"text\" name=\"realname\" size=\"40\"> Your Name<br>\n";
  367. print "<input type=\"text\" value=\"$FORM{'username'}\" name=\"username\" size=\"40\"> E-mail<br>\n";
  368. print "<input type=\"text\" name=\"url\" value=\"$FORM{'url'}\" size=\"40\"> Your URL<br>\n";
  369. print "\n";
  370. print "<p>\n";
  371. print "<table width=\"400\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
  372. print "\n";
  373. print "<tr>\n";
  374. print "    <td align=\"left\">\n";
  375. print "    <input type=\"text\" name=\"city\" value=\"$FORM{'city'}\" size=\"15\"><br>City</td>\n";
  376. print "    <td align=\"left\">\n";
  377. print "    <input type=\"text\" name=\"state\" value=\"$FORM{'state'}\" size=\"15\"><br>State</td>\n";
  378. print "    <td align=\"left\">\n";
  379. print "    <input type=\"text\" name=\"country\" value=\"$FORM{'country'}\" size=\"10\"><br>Country</td>\n";
  380. print "\n";
  381. print "</tr></table>\n";
  382. print "\n";
  383. print "<p>\n";
  384. print "Comments:<br>\n";
  385. print "<textarea name=\"comments\" value=\"$FORM{'comments'}\" COLS=\"60\" ROWS=\"4\"></textarea><p>\n";
  386. print "\n";
  387. print "<table width=\"400\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
  388. print "<tr>\n";
  389. print "    <td align=\"left\">\n";
  390. print "    <input value=\"Reinscribe Guestbook\" type=\"submit\"></td>\n";
  391. print "    <td align=\"left\">\n";
  392. print "    <input value=\"Reset Form\" type=\"reset\"></td>\n";
  393. print "</tr></table>\n";
  394. print "\n";
  395. print "    </form>\n";
  396. print "\n";
  397. print "    </td>\n";
  398. print "    </tr>\n";
  399. print "</table>\n";
  400. print "  </body>\n";
  401. print "</html>\n";
  402.  
  403.  
  404.    # Log The Error
  405.    if ($uselog eq '1') {
  406.       &log('no_name');
  407.    }
  408.  
  409.    exit;
  410. }
  411.  
  412. # Log the Entry or Error
  413. sub log {
  414.    $log_type = $_[0];
  415.    open (LOG, ">>$guestlog");
  416.    if ($log_type eq 'entry') {
  417.       print LOG "$ENV{'REMOTE_HOST'} - [$shortdate]<br>\n";
  418.    }
  419.    elsif ($log_type eq 'no_name') {
  420.       print LOG "$ENV{'REMOTE_HOST'} - [$shortdate] - ERR: No Name<br>\n";
  421.    }
  422.    elsif ($log_type eq 'no_comments') {
  423.       print LOG "$ENV{'REMOTE_HOST'} - [$shortdate] - ERR: No ";
  424.       print LOG "Comments<br>\n";
  425.    }
  426. }
  427.  
  428. # Redirection Option
  429. sub no_redirection {
  430.  
  431. # Print Beginning of HTML
  432. print "Content-Type: text/html\n\n";
  433. print "<html><head><title>Thank You</title></head>\n";
  434. print "<BODY BGCOLOR=\"#FFFFFF\" background=\"/Images/expo_hbk_01.gif\" TEXT=\"#000000\" LINK=\"#97694F\" VLINK=\"#42426f\">\n";
  435. print "\n";
  436. print "<a href=\"/cgi-bin/imagemap/Images/htoolbar.map\">\n";
  437. print "<img align=\"left\" width=\"486\" height=\"101\" \n";
  438. print "SRC=\"/Images/htoolbar.gif\" ISMAP border=\"0\"></a>\n";
  439. print "<br clear=\"all\">\n";
  440. print "\n";
  441. print "<table width=\"500\" height=\"0\"  border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
  442. print "<tr>\n";
  443. print "<td align=\"left\" valign=\"top\" height=\"26\" colspan=\"2\">\n";
  444. print "</td></tr>\n";
  445. print "<tr>\n";
  446. print "<td align=\"left\" valign=\"top\" width=\"100\"></td>\n";
  447. print "\n";
  448. print "<td align=\"left\" valign=\"top\" width=\"400\">\n";
  449. print "\n";
  450. print "<p>\n";
  451. print "<font size=\"+2\"><b>\n";
  452. print "<a href=\"http://town.hall.org/Archives/radio/IMS/SoundBytes/111894_byte_01_RTFM.au\">Thank You!</a>\n";
  453. print "</font size=\"+2\"></b>\n";
  454. print "\n";
  455. print "<p>\n";
  456.  
  457.  
  458.    # Print Response
  459.    print "Thank you for filling in the guestbook.  Your entry has\n";
  460.    print "been added to the guestbook.\n";
  461.    print "Here is what you submitted:<p>\n";
  462.    print "<hr><p>$FORM{'comments'}<p>\n";
  463.  
  464.    if ($FORM{'url'}) {
  465.       print "<a href=\"$FORM{'url'}\">$FORM{'realname'}</a>";
  466.    }
  467.    else {
  468.       print "$FORM{'realname'}";
  469.    }
  470.  
  471.    if ( $FORM{'username'} ){
  472.       if ($linkmail eq '1') {
  473.          print " \(<a href=\"mailto:$FORM{'username'}\">";
  474.          print "$FORM{'username'}</a>\)";
  475.       }
  476.       else {
  477.          print " \($FORM{'username'}\)";
  478.       }
  479.    }
  480.  
  481.    print "<br>\n";
  482.  
  483.    if ( $FORM{'city'} ){
  484.       print "$FORM{'city'},";
  485.    }
  486.  
  487.    if ( $FORM{'state'} ){
  488.       print " $FORM{'state'}";
  489.    }
  490.  
  491.    if ( $FORM{'country'} ){
  492.       print " $FORM{'country'}";
  493.    }
  494.  
  495.    print "<br>$date<p>\n";
  496.  
  497.    # Print End of HTML
  498.    print "<p><hr><p>\n";
  499.    print "<a href=\"$guestbookurl\">Back to the Guestbook</a>\n";         
  500.     print "- You may need to reload it when you get there to see your\n";
  501.    print "entry.\n";
  502.  
  503. print "\n";
  504. print "\n";
  505. print "</td>\n";
  506. print "</tr>\n";
  507. print "</table>\n";
  508. print " </body>\n";
  509. print "</html>\n";
  510.  
  511.  
  512.    exit;
  513. }
  514.  
  515.  
  516. #
  517. # basic file locking support - bjb, 02-jan-1996
  518. #
  519.  
  520. #
  521. # create lock file
  522. #
  523. sub lockFile {
  524.     # current retry attempt
  525.     local($lockAttempts) = 1;
  526.     # max retry limit
  527.     local($lockMaxAttempts) = 3;
  528.  
  529.     while (-f "$lockfile") {
  530.         if ($lockAttempts > $lockMaxAttempts) {
  531.             return 1;
  532.         }
  533.         sleep 1;
  534.         $lockAttempts++;
  535.     }
  536.  
  537.     open(LOCK, ">$lockfile") || &lock_failed;
  538.         print "lock successfull\n" if $debug
  539.     return 0;
  540. }
  541.  
  542. #
  543. # remove lock file
  544. #
  545. sub unlockFile {
  546.     unlink("$lockfile");
  547. }
  548.  
  549. #
  550. # generate lock failed message
  551. #
  552. sub lock_failed {
  553.    print <<EoI;
  554. Content-type: text/html
  555.  
  556. <html><head><title>File Lock Failed</title></head>
  557.  
  558. <BODY BGCOLOR="#FFFFFF" background="/Images/expo_hbk_01.gif" TEXT="#000000" LINK="#97694F" VLINK="#42426f">
  559.  
  560. <a href="/cgi-bin/imagemap/Images/htoolbar.map">
  561. <img align="left" width="486" height="101" 
  562. SRC="/Images/htoolbar.gif" ISMAP border="0"></a>
  563. <br clear="all">
  564.  
  565. <table width="500" height="0"  border="0" cellpadding="0" cellspacing="0">
  566.     <tr>
  567.         <td align="left" valign="top" height="26" colspan="2">
  568.     </td></tr>
  569. <tr>
  570. <td align="left" valign="top" width="100"></td>
  571.  
  572. <td align="left" valign="top" width="400">
  573.  
  574. <p>
  575. <font size="+2"><b>File Locking Failed</font></b>
  576.  
  577. <p>
  578. Unable to update guestbook because somebody else was submitting their
  579. comments.  Would you mind trying again by resubmitting?
  580. <p>
  581. <form method=POST action="$cgiurl">
  582.  
  583. <input type="text" value="$FORM{'realname'}" name="realname" size="40"> Your Name<br>
  584. <input type="text" value="$FORM{'username'}" name="username" size="40"> E-mail<br>
  585. <input type="text" name="url" value="$FORM{'url'}" size="40"> Your URL<br>
  586.  
  587. <p>
  588. <table width="400" border="0" cellpadding="0" cellspacing="0">
  589.  
  590. <tr>
  591.     <td align="left">
  592.     <input type="text" name="city" value="$FORM{'city'}" size="15"><br>City</td>
  593.     <td align="left">
  594.     <input type="text" name="state" value="$FORM{'state'}" size="15"><br>State</td>
  595.     <td align="left">
  596.     <input type="text" name="country" value="$FORM{'country'}" size="10"><br>Country</td>
  597.  
  598. </tr></table>
  599.  
  600. <p>
  601. Comments:<br>
  602. <textarea name="comments" value="$FORM{'comments'}" COLS="60" ROWS="4"></textarea><p>
  603.  
  604. <table width="400" border="0" cellpadding="0" cellspacing="0">
  605. <tr>
  606.     <td align="left">
  607.     <input value="Reinscribe Guestbook" type="submit"></td>
  608.     <td align="left">
  609.     <input value="Reset Form" type="reset"></td>
  610. </tr></table>
  611.  
  612.     </form>
  613.  
  614.     </td>
  615.     </tr>
  616. </table>
  617.  
  618. </body>
  619. </html>
  620.  
  621. EoI
  622.  
  623.     # Log The Error
  624.     if ($uselog eq '1') {
  625.         &log('lock_failed');
  626.     }
  627.  
  628.     exit 0;
  629. }
  630.  
  631.