★ wanayoo — archive 1999 http://www.getscript.com/anatomy.htmlNouvelle recherche | Portail wanayoo
Please Support Our Sponsor Above. Thanks!

DBasics Software Company offers complete Internet services except ISP dialup services. For those familiar with CGI scripts, we have a variety of powerful web management scripts from statistical counters to web forums. For those who don't have the time to learn how to install CGI scripts, we offer installation for all our scripts. We also offer web hosting options, online secure credit card payment options and more
[Home] [Company] [Hosting] [Scripts] [Support] [Forums]
[Purchase] [Freebies] [Tutorials] [Services] [Advertising]
DBasics Software Company
Last Updated: Monday, 10-Jul-2000 14:45:24 EDT


Overview and Introduction [top] [next]

We're taking Matt's Script WWWBoard 2.0 Alpha 2's wwwboard.pl and taking it apart line by line. We'll try to provide as much information as possible in helping you understand how the web board works and how you can modify it to meet your own needs.

Matt's Script is one of the most widely used and publicized script on the Net. If it's a popular web application, Matt Wright has it. And as more people come online, the numbers using his scripts are increasing. I know this because our site's traffic from Matt's Script is steadily increasing and we only have a few links from Matt's Script.

So, if you found us through Matt's Script we highly recommend you have Matt's Script bookmarked under CGI scripts.

WWWBoard 2.0 Alpha 2 is more than just a message board. When you understand the inner workings of the board, you'll see it's applications are far reaching. A few modifications and you have a classified ad system, a product catalog, technical support medium or a just powerful customized web board. After we dissect the wwwboard.cgi file, we'll provide the step-by-step modifications to personalize your web board.

The easiest way to complete this anatomy class is to follow all colored unvisited links. You'll find our comments appear in green. When you reach the end, hopefully everything will seem to be more black and white.

It is recommended that you start at the top and read down. If you see something you don't quite understand, click on it to view additional information. In some cases we have linked directly to relevant pages elsewhere.

Again a reminder, clicking on the ....

  1. Unvisited link color will provide additional information.
  2. Visited links appear as Black text
  3. Our .02 cents appears in green.

Estimated completion time? Is ... well ... it's based upon you I guess.
So please take note when you began. Okay?


Script Header and Copyright [back] [top] [next]

#!/usr/local/bin/perl
###########################################################################
# WWWBoard
# Version 2.0 ALPHA 2
# Created by Matt Wright
# Created on:  10/21/95         Last Modified on:  11/25/95
# I can be reached at:          mattw@xtc.net
# Scripts Found at:             http://worldwidemart.com/scripts/
###########################################################################


Defining Global Variables [back] [top] [next]

# Define Variables
$basedir = "/path/to/wwwboard";
$baseurl = "http://your.host.xxx/wwwboard";
$cgi_url = "http://your.host.xxx/cgi-bin/wwwboard.pl";

$mesgdir = "messages";
$datafile = "data.txt";
$mesgfile = "wwwboard.html";
$faqfile = "faq.html";

$ext = "html";

$title = "WWWBoard Version 2.0 Test";

Default Configurations [back] [top] [next]

# Configure Options 
$show_faq = 1;		# 1 - YES; 0 = NO
$allow_html = 1;	# 1 = YES; 0 = NO
$quote_text = 1;	# 1 = YES; 0 = NO
$subject_line = 0;	# 0 = Quote Subject Editable; 1 = Quote Subject UnEditable; 2 = Don't Quote Subject, Editable.
$use_time = 1;		# 1 = YES; 0 = NO

Subroutine Processing [back] [top]

# Get the Data Number
&get_number; # Simple subroutine that assigns $num the next message number.

# Get Form Information
&parse_form; # Parse $FORM{'ELEMENTS'} From WWWBoard's Post A Message.

# Put items into nice variables
&get_variables; # Creates new variables from environmental and User Input variables.

# Open the new file and write information to it.
&new_file; # Create the new message file in HTML format

# Open the Main WWWBoard File to add link
&main_page; # Update main page with new message

# Now Add Thread to Individual Pages
if ($num_followups >= 1) {
  &thread_pages; # Update threaded pages with new message
}

# Return the user HTML
&return_html; # Display results of actions taken.

# Increment Number
&increment_num; # Record the message number created

# Done!
exit; # Whatever it is you do when you're done?



# Get Data Number Subroutine [back] [top]

This subroutine obtains the next message number.
sub get_number {
# The subroutine was called with an & (ampersand).

  open(NUMBER,"$basedir/$datafile");
# Opens the $basedir/$datafile File (/path/to/wwwboard.htmldata.txt) from Define Variables above. NUMBER is an alias file name used once the file is opened.

  $num = <NUMBER>;
# Assigns the value from $basedir/$datafile into the variable called $num by referencing the file alias NUMBER.

  close(NUMBER);
# Now closes the $basedir/$datafile file, again using the alias NUMBER.

  if ($num == 99999) {
    $num = "1";
  } else {
    $num++; }
# Determine if the value of $num equals 99999. If it does, replace the value in $num to equal 1 or else take the value in $num and increment it by 1.

}
# The closing structure to end the &get_number routine. We are returning a variable named $num with a numeric value assigned. It was getting this number that this subroutine was suppose to accomplish.


# Parse Form Subroutine [back] [top]

This subroutine takes the input data from the "Post a Message" form and does that $FORM{'name'} stuff to it.
sub parse_form {
   # Get the input
   read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
   # Split the name-value pairs
   @pairs = split(/&/, $buffer);
   foreach $pair (@pairs) {
      ($name, $value) = split(/=/, $pair);
      # Un-Webify plus signs and %-encoding
      $value =~ tr/+/ /;
      $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
      $value =~ s/<!--(.|\n)*-->//g;
      if ($allow_html != 1) {
         $value =~ s/<([^>]|\n)*>//g;
      } else {
         unless ($name eq 'body') {
	    $value =~ s/<([^>]|\n)*>//g;
         }
      }
      $FORM{$name} = $value;
   }
}


# Get Variables [back] [top]

This subroutine takes the output of the Parse Form Subroutine and converts/dresses up and creates new variables.
sub get_variables {
   if ($FORM{'followup'}) {
      $followup = "1";
      @followup_num = split(/,/,$FORM{'followup'});
      $num_followups = @followups = @followup_num;
      $last_message = pop(@followups);
      $origdate = "$FORM{'origdate'}";
      $origname = "$FORM{'origname'}";
      $origsubject = "$FORM{'origsubject'}";
   }
   else {
      $followup = "0";
   }

   if ($FORM{'name'}) {
      $name = "$FORM{'name'}";
      $name =~ s/"//g;
      $name =~ s/<//g;
      $name =~ s/>//g;
      $name =~ s/\&//g;
   }
   else {
      &error(no_name);
   }

   if ($FORM{'email'} =~ /.*\@.*\..*/) {
      $email = "$FORM{'email'}";
   }

   if ($FORM{'subject'}) {
      $subject = "$FORM{'subject'}";
      $subject =~ s/\&/\&\;/g;
      $subject =~ s/"/\"\;/g;
   }
   else {
      &error(no_subject);
   }

   if ($FORM{'url'} =~ /.*\:.*\..*/ && $FORM{'url_title'}) {
      $message_url = "$FORM{'url'}";
      $message_url_title = "$FORM{'url_title'}";
   }

   if ($FORM{'img'} =~ /.*tp:\/\/.*\..*/) {
      $message_img = "$FORM{'img'}";
   }

   if ($FORM{'body'}) {
      $body = "$FORM{'body'}";
      $body =~ s/\cM//g;
      $body =~ s/\n\n/<p>/g;
      $body =~ s/\n/<br>/g;

      $body =~ s/</</g; 
      $body =~ s/>/>/g; 
      $body =~ s/"/"/g;
   }
   else {
      &error(no_body);
   }

   if ($quote_text == 1) {
      $hidden_body = "$body";
      $hidden_body =~ s/</</g;
      $hidden_body =~ s/>/>/g;
      $hidden_body =~ s/"/"/g;
   }

   ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);

   if ($sec < 10) {
      $sec = "0$sec";
   }
   if ($min < 10) {
      $min = "0$min";
   }
   if ($hour < 10) {
      $hour = "0$hour";
   }
   if ($mon < 10) {
      $mon = "0$mon";
   }
   if ($mday < 10) {
      $mday = "0$mday";
   }

   $month = ($mon + 1);

   @months = ("January","February","March","April","May","June","July","August","September","October","November","December");

   if ($use_time == 1) {
      $date = "$hour\:$min\:$sec $month/$mday/$year";
   }
   else {
      $date = "$month/$mday/$year";
   }
   chop($date) if ($date =~ /\n$/);

   $long_date = "$months[$mon] $mday, 19$year at $hour\:$min\:$sec";
}


# New Message File Subroutine [back] [top]

This subroutine
sub new_file {
   open(NEWFILE,">$basedir/$mesgdir/$num\.$ext") || die $!;
   print NEWFILE "<html>\n";
   print NEWFILE "  <head>\n";
   print NEWFILE "    <title>$subject</title>\n";
   print NEWFILE "  </head>\n";
   print NEWFILE "  <body>\n";
   print NEWFILE "    <center>\n";
   print NEWFILE "      <h1>$subject</h1>\n";
   print NEWFILE "    </center>\n";
   print NEWFILE "<hr size=7 width=75%>\n";
   if ($show_faq == 1) {
      print NEWFILE "<center>[ <a href=/old?u=http%3A%2F%2Fwww.getscript.com%2F%5C%26quot%23followups%5C%26quot%3B%26gt%3BFollow&y=1999 Ups</a> ] [ <a href=/old?u=http%3A%2F%2Fwww.getscript.com%2F%5C%26quot%23postfp%5C%26quot%3B%26gt%3BPost&y=1999 Followup</a> ] [ <a href=/old?u=http%3A%2F%2Fwww.getscript.com%2F%5C%26quot%3B%24baseurl%2F%24mesgfile%5C%26quot%3B%26gt%3B%24title%26lt%3B%2Fa%26gt&y=1999 ] [ <a href=/old?u=http%3A%2F%2Fwww.getscript.com%2F%5C%26quot%3B%24baseurl%2F%24faqfile%5C%26quot%3B%26gt%3BFAQ%26lt%3B%2Fa%26gt&y=1999 ]</center>\n";
   }
   else {
      print NEWFILE "<center>[ <a href=/old?u=http%3A%2F%2Fwww.getscript.com%2F%5C%26quot%23followups%5C%26quot%3B%26gt%3BFollow&y=1999 Ups</a> ] [ <a href=/old?u=http%3A%2F%2Fwww.getscript.com%2F%5C%26quot%23postfp%5C%26quot%3B%26gt%3BPost&y=1999 Followup</a> ] [ <a href=/old?u=http%3A%2F%2Fwww.getscript.com%2F%5C%26quot%3B%24baseurl%2F%24mesgfile%5C%26quot%3B%26gt%3B%24title%26lt%3B%2Fa%26gt&y=1999 ]</center>\n";
   }
   print NEWFILE "<hr size=7 width=75%><p>\n";

   print NEWFILE "Posted by ";

   if ($email) {
      print NEWFILE "<a href=/old?u=http%3A%2F%2Fwww.getscript.com%2F%5C%26quot%3Bmailto%3A%24email%5C%26quot%3B%26gt%3B%24name%26lt%3B%2Fa%26gt&y=1999 on $long_date:<p>\n";
   }
   else {
      print NEWFILE "$name on $long_date:<p>\n";
   }

   if ($followup == 1) {
      print NEWFILE "In Reply to: <a href=/old?u=http%3A%2F%2Fwww.getscript.com%2F%5C%26quot%3B%24last_message%5C.%24ext%5C%26quot%3B%26gt%3B%24origsubject%26lt%3B%2Fa%26gt&y=1999 posted by ";

      if ($origemail) {
         print NEWFILE "<a href=/old?u=http%3A%2F%2Fwww.getscript.com%2F%5C%26quot%3B%24origemail%5C%26quot%3B%26gt%3B%24origname%26lt%3B%2Fa%26gt&y=1999 on $origdate:<p>\n";
      }
      else {
         print NEWFILE "$origname on $origdate:<p>\n";
      }
   }

   if ($message_img) {
      print NEWFILE "<center><img src=/old?u=http%3A%2F%2Fwww.getscript.com%2F%5C%26quot%3B%24message_img%5C%26quot%3B%26gt%3B%26lt%3B%2Fcenter%26gt%3B%26lt%3Bp%26gt%3B%5Cn%26quot%3B%3B&y=1999
   }
   print NEWFILE "$body\n";
   print NEWFILE "<br>\n";
   if ($message_url) {
      print NEWFILE "<ul><li><a href=/old?u=http%3A%2F%2Fwww.getscript.com%2F%5C%26quot%3B%24message_url%5C%26quot%3B%26gt%3B%24message_url_title%26lt%3B%2Fa%26gt%3B%26lt%3B%2Ful%26gt%3B%5Cn%26quot%3B%3B&y=1999
   }
   print NEWFILE "<br><hr size=7 width=75%><p>\n";
   print NEWFILE "<a name=\"followups\">Follow Ups:</a><br>\n";
   print NEWFILE "<ul><!--insert: $num-->\n";
   print NEWFILE "</ul><!--end: $num-->\n";
   print NEWFILE "<br><hr size=7 width=75%><p>\n";
   print NEWFILE "<a name=\"postfp\">Post a Followup</a><p>\n";
   print NEWFILE "<form method=POST action=/old?u=http%3A%2F%2Fwww.getscript.com%2F%5C%26quot%3B%24cgi_url%5C%26quot%3B%26gt%3B%5Cn%26quot%3B%3B&y=1999
   print NEWFILE "<input type=hidden name=\"followup\" value=\"";
   if ($followup == 1) {
      foreach $followup_num (@followup_num) {
         print NEWFILE "$followup_num,";
      }
   }
   print NEWFILE "$num\">\n";
   print NEWFILE "<input type=hidden name=\"origname\" value=\"$name\">\n";
   if ($email) {
      print NEWFILE "<input type=hidden name=\"origemail\" value=\"$email\">\n";
   }
   print NEWFILE "<input type=hidden name=\"origsubject\" value=\"$subject\">\n";
   print NEWFILE "<input type=hidden name=\"origdate\" value=\"$long_date\">\n";
   print NEWFILE "Name: <input type=text name=\"name\" size=50><br>\n";
   print NEWFILE "E-Mail: <input type=text name=\"email\" size=50><p>\n";
   if ($subject_line == 1) {
      if ($subject_line =~ /^Re:/) {
         print NEWFILE "<input type=hidden name=\"subject\" value=\"$subject\">\n";
         print NEWFILE "Subject: <b>$subject</b><p>\n";
      }
      else {
         print NEWFILE "<input type=hidden name=\"subject\" value=\"Re: $subject\">\n";
         print NEWFILE "Subject: <b>Re: $subject</b><p>\n";
      }
   } 
   elsif ($subject_line == 2) {
      print NEWFILE "Subject: <input type=text name=\"subject\" size=50><p>\n";
   }
   else {
      if ($subject =~ /^Re:/) {
         print NEWFILE "Subject: <input type=text name=\"subject\"value=\"$subject\" size=50><p>\n";
      }
      else {
         print NEWFILE "Subject: <input type=text name=\"subject\" value=\"Re: $subject\" size=50><p>\n";
      }
   }
   print NEWFILE "Comments:<br>\n";
   print NEWFILE "<textarea name=\"body\" COLS=50 ROWS=10>\n";
   if ($quote_text == 1) {
      @chunks_of_body = split(/\<\;p\>\;/,$hidden_body);
      foreach $chunk_of_body (@chunks_of_body) {
         @lines_of_body = split(/\<\;br\>\;/,$chunk_of_body);
         foreach $line_of_body (@lines_of_body) {
            print NEWFILE ": $line_of_body\n";
         }
         print NEWFILE "\n";
      }
   }
   print NEWFILE "</textarea>\n";
   print NEWFILE "<p>\n";
   print NEWFILE "Optional Link URL: <input type=text name=\"url\" size=50><br>\n";
   print NEWFILE "Link Title: <input type=text name=\"url_title\" size=48><br>\n";
   print NEWFILE "Optional Image URL: <input type=text name=\"img\" size=49><p>\n";
   print NEWFILE "<input type=submit value=\"Submit Follow Up\"> <input type=reset>\n";
   print NEWFILE "<p><hr size=7 width=75%>\n";
   if ($show_faq == 1) {
      print NEWFILE "<center>[ <a href=/old?u=http%3A%2F%2Fwww.getscript.com%2F%5C%26quot%23followups%5C%26quot%3B%26gt%3BFollow&y=1999 Ups</a> ] [ <a href=/old?u=http%3A%2F%2Fwww.getscript.com%2F%5C%26quot%23postfp%5C%26quot%3B%26gt%3BPost&y=1999 Followup</a> ] [ <a href=/old?u=http%3A%2F%2Fwww.getscript.com%2F%5C%26quot%3B%24baseurl%2F%24mesgfile%5C%26quot%3B%26gt%3B%24title%26lt%3B%2Fa%26gt&y=1999 ] [ <a href=/old?u=http%3A%2F%2Fwww.getscript.com%2F%5C%26quot%3B%24baseurl%2F%24faqfile%5C%26quot%3B%26gt%3BFAQ%26lt%3B%2Fa%26gt&y=1999 ]</center>\n";
   }
   else {
      print NEWFILE "<center>[ <a href=/old?u=http%3A%2F%2Fwww.getscript.com%2F%5C%26quot%23followups%5C%26quot%3B%26gt%3BFollow&y=1999 Ups</a> ] [ <a href=/old?u=http%3A%2F%2Fwww.getscript.com%2F%5C%26quot%23postfp%5C%26quot%3B%26gt%3BPost&y=1999 Followup</a> ] [ <a href=/old?u=http%3A%2F%2Fwww.getscript.com%2F%5C%26quot%3B%24baseurl%2F%24mesgfile%5C%26quot%3B%26gt%3B%24title%26lt%3B%2Fa%26gt&y=1999 ]</center>\n";
   }
   print NEWFILE "</body></html>\n";
}


# Main WWWBoard Page Subroutine [back] [top]

This subroutine
sub main_page {
   open(MAIN,"$basedir/$mesgfile") || die $!;
   @main = <MAIN>;
   close(MAIN);

   open(MAIN,">$basedir/$mesgfile") || die $!;
   if ($followup == 0) {
      foreach $main_line (@main) {
         if ($main_line =~ /<!--begin-->/) {
            print MAIN "<!--begin-->\n";
	    print MAIN "<!--top: $num--><li><a href=/old?u=http%3A%2F%2Fwww.getscript.com%2F%5C%26quot%3B%24mesgdir%2F%24num%5C.%24ext%5C%26quot%3B%26gt%3B%24subject%26lt%3B%2Fa%26gt&y=1999 - <b>$name</b> <i>$date</i>\n";
            print MAIN "(<!--responses: $num-->0)\n";
            print MAIN "<ul><!--insert: $num-->\n";
            print MAIN "</ul><!--end: $num-->\n";
         }
         else {
            print MAIN "$main_line";
         }
      }
   }
   else {
      foreach $main_line (@main) {
	 $work = 0;
         if ($main_line =~ /<ul><!--insert: $last_message-->/) {
            print MAIN "<ul><!--insert: $last_message-->\n";
            print MAIN "<!--top: $num--><li><a href=/old?u=http%3A%2F%2Fwww.getscript.com%2F%5C%26quot%3B%24mesgdir%2F%24num%5C.%24ext%5C%26quot%3B%26gt%3B%24subject%26lt%3B%2Fa%26gt&y=1999 - <b>$name</b> <i>$date</i>\n";
            print MAIN "(<!--responses: $num-->0)\n";
            print MAIN "<ul><!--insert: $num-->\n";
            print MAIN "</ul><!--end: $num-->\n";
         }
         elsif ($main_line =~ /\(<!--responses: (.*)-->(.*)\)/) {
            $response_num = $1;
            $num_responses = $2;
            $num_responses++;
            foreach $followup_num (@followup_num) {
               if ($followup_num == $response_num) {
                  print MAIN "(<!--responses: $followup_num-->$num_responses)\n";
		  $work = 1;
               }
            }
            if ($work != 1) {
               print MAIN "$main_line";
            }
         }
         else {
            print MAIN "$main_line";
         }
      }
   }
   close(MAIN);
}


# Add Followup Threading to Individual Pages [back] [top]

This subroutine
sub thread_pages {

   foreach $followup_num (@followup_num) {
      open(FOLLOWUP,"$basedir/$mesgdir/$followup_num\.$ext");
      @followup_lines = <FOLLOWUP>;
      close(FOLLOWUP);

      open(FOLLOWUP,">$basedir/$mesgdir/$followup_num\.$ext");
      foreach $followup_line (@followup_lines) {
         $work = 0;
         if ($followup_line =~ /<ul><!--insert: $last_message-->/) {
	    print FOLLOWUP "<ul><!--insert: $last_message-->\n";
            print FOLLOWUP "<!--top: $num--><li><a href=/old?u=http%3A%2F%2Fwww.getscript.com%2F%5C%26quot%3B%24num%5C.%24ext%5C%26quot%3B%26gt%3B%24subject%26lt%3B%2Fa%26gt&y=1999 <b>$name</b> <i>$date</i>\n";
            print FOLLOWUP "(<!--responses: $num-->0)\n";
            print FOLLOWUP "<ul><!--insert: $num-->\n";
            print FOLLOWUP "</ul><!--end: $num-->\n";
         }
         elsif ($followup_line =~ /\(<!--responses: (.*)-->(.*)\)/) {
            $response_num = $1;
            $num_responses = $2;
            $num_responses++;
            foreach $followup_num (@followup_num) {
               if ($followup_num == $response_num) {
                  print FOLLOWUP "(<!--responses: $followup_num-->$num_responses)\n";
                  $work = 1;
               }
            }
            if ($work != 1) {
               print FOLLOWUP "$followup_line";
            }
         }
         else {
            print FOLLOWUP "$followup_line";
         }
      }
      close(FOLLOWUP);
   }
}


# Display HTML Results (Top) [back] [top]

This subroutine
sub return_html {
   print "Content-type: text/html\n\n";
   print "<html><head><title>Message Added: $subject</title></head>\n";
   print "<body><center><h1>Message Added: $subject</h1></center>\n";
   print "The following information was added to the message board:<p><hr size=7 width=75%><p>\n";
   print "<b>Name:</b> $name<br>\n";
   print "<b>E-Mail:</b> $email<br>\n";
   print "<b>Subject:</b> $subject<br>\n";
   print "<b>Body of Message:</b><p>\n";
   print "$body<p>\n";
   if ($message_url) {
      print "<b>Link:</b> <a href=/old?u=http%3A%2F%2Fwww.getscript.com%2F%5C%26quot%3B%24message_url%5C%26quot%3B%26gt%3B%24message_url_title%26lt%3B%2Fa%26gt%3B%26lt%3Bbr%26gt%3B%5Cn%26quot%3B%3B&y=1999
   }
   if ($message_img) {
      print "<b>Image:</b> <img src=/old?u=http%3A%2F%2Fwww.getscript.com%2F%5C%26quot%3B%24message_img%5C%26quot%3B%26gt%3B%26lt%3Bbr%26gt%3B%5Cn%26quot%3B%3B&y=1999
   }
   print "<b>Added on Date:</b> $date<p>\n";
   print "<hr size=7 width=75%>\n";
   print "<center>[ <a href=/old?u=http%3A%2F%2Fwww.getscript.com%2F%5C%26quot%3B%24baseurl%2F%24mesgdir%2F%24num%5C.%24ext%5C%26quot%3B%26gt%3BGo&y=1999 to Your Message</a> ] [ <a href=/old?u=http%3A%2F%2Fwww.getscript.com%2F%5C%26quot%3B%24baseurl%2F%24mesgfile%5C%26quot%3B%26gt%3B%24title%26lt%3B%2Fa%26gt&y=1999 ]</center>\n";
   print "</body></html>\n";
}


# Increment Message Number [back] [top]

This subroutine
sub increment_num {
   open(NUM,">$basedir/$datafile") || die $!;
   print NUM "$num";
   close(NUM);
}


# Error Handling Routines [back] [top]

This subroutine
sub error {
   $error = $_[0];

   print "Content-type: text/html\n\n";

   if ($error eq 'no_name') {
      print "<html><head><title>$title ERROR: No Name</title></head>\n";
      print "<body><center><h1>ERROR: No Name</h1></center>\n";
      print "You forgot to fill in the 'Name' field in your posting.  Correct it below and re-submit.  The necessary fields are: Name, Subject and Message.<p><hr size=7 width=75%><p>\n";
      &rest_of_form;
   }
   elsif ($error eq 'no_subject') {
      print "<html><head><title>$title ERROR: No Subject</title></head>\n";
      print "<body><center><h1>ERROR: No Subject</h1></center>\n";
      print "You forgot to fill in the 'Subject' field in your posting.  Correct it below and re-submit.  The necessary fields are: Name, Subject and Message.<p><hr size=7 width=75%><p>\n";
      &rest_of_form;
   }
   elsif ($error eq 'no_body') {
      print "<html><head><title>$title ERROR: No Message</title></head>\n";
      print "<body><center><h1>ERROR: No Message</h1></center>\n";
      print "You forgot to fill in the 'Message' fieldin your posting.  Correct it below and re-submit.  The necessary fields are: Name, Subjectand Message.<p><hr size=7 width=75%><p>\n";
      &rest_of_form;
   }
   else {
      print "ERROR!  Undefined.\n";
   }
   exit;
}


# Display HTML Results (Bottom) [back] [top]

This subroutine
sub rest_of_form {

   print "<form method=POST action=/old?u=http%3A%2F%2Fwww.getscript.com%2F%5C%26quot%3B%24cgi_url%5C%26quot%3B%26gt%3B%5Cn%26quot%3B%3B&y=1999

   if ($followup == 1) {
      print "<input type=hidden name=\"origsubject\" value=\"$FORM{'origsubject'}\">\n";
      print "<input type=hidden name=\"origname\" value=\"$FORM{'origname'}\">\n";
      print "<input type=hidden name=\"origemail\" value=\"$FORM{'origemail'}\">\n";
      print "<input type=hidden name=\"origdate\" value=\"$FORM{'origdate'}\">\n";
      print "<input type=hidden name=\"followup\" value=\"$FORM{'followup'}\">\n";
   }
   print "Name: <input type=text name=\"name\" value=\"$FORM{'name'}\" size=50><br>\n";
   print "E-Mail: <input type=text name=\"email\" value=\"$FORM{'email'}\" size=50><p>\n";
   if ($subject_line == 1) {
      print "<input type=hidden name=\"subject\" value=\"$FORM{'subject'}\">\n";
      print "Subject: <b>$FORM{'subject'}</b><p>\n";
   } 
   else {
      print "Subject: <input type=text name=\"subject\" value=\"$FORM{'subject'}\" size=50><p>\n";
   }
   print "Message:<br>\n";
   print "<textarea COLS=50 ROWS=10 name=\"body\">\n";
   $FORM{'body'} =~ s/</</g;
   $FORM{'body'} =~ s/>/>/g;
   $FORM{'body'} =~ s/"/"/g;
   print "$FORM{'body'}\n";
   print "</textarea><p>\n";
   print "Optional Link URL: <input type=text name=\"url\" value=\"$FORM{'url'}\" size=45><br>\n";
   print "Link Title: <input type=text name=\"url_title\" value=\"$FORM{'url_title'}\" size=50><br>\n";
   print "Optional Image URL: <input type=text name=\"img\" value=\"$FORM{'img'}\" size=45><p>\n";
   print "<input type=submit value=\"Post Message\"> <input type=reset>\n";
   print "</form>\n";
   print "<br><hr size=7 width=75%>\n";
   if ($show_faq == 1) {
      print NEWFILE "<center>[ <a href=/old?u=http%3A%2F%2Fwww.getscript.com%2F%5C%26quot%23followups%5C%26quot%3B%26gt%3BFollow&y=1999 Ups</a> ] [ <a href=/old?u=http%3A%2F%2Fwww.getscript.com%2F%5C%26quot%23postfp%5C%26quot%3B%26gt%3BPost&y=1999 Followup</a> ] [ <a href=/old?u=http%3A%2F%2Fwww.getscript.com%2F%5C%26quot%3B%24baseurl%2F%24mesgfile%5C%26quot%3B%26gt%3B%24title%26lt%3B%2Fa%26gt&y=1999 ] [ <a href=/old?u=http%3A%2F%2Fwww.getscript.com%2F%5C%26quot%3B%24baseurl%2F%24faqfile%5C%26quot%3B%26gt%3BFAQ%26lt%3B%2Fa%26gt&y=1999 ]</center>\n";
   }
   else {
      print NEWFILE "<center>[ <a href=/old?u=http%3A%2F%2Fwww.getscript.com%2F%5C%26quot%23followups%5C%26quot%3B%26gt%3BFollow&y=1999 Ups</a> ] [ <a href=/old?u=http%3A%2F%2Fwww.getscript.com%2F%5C%26quot%23postfp%5C%26quot%3B%26gt%3BPost&y=1999 Followup</a> ] [ <a href=/old?u=http%3A%2F%2Fwww.getscript.com%2F%5C%26quot%3B%24baseurl%2F%24mesgfile%5C%26quot%3B%26gt%3B%24title%26lt%3B%2Fa%26gt&y=1999 ]</center>\n";
   }
   print "</body></html>\n";
}



We've Displayed Pages to Visitors Today.


(DBasics Software's ICQ# 4652929)

Copyright © 2000 All Rights Reserved
DBasics Software Company
P.O. Box 986, Sunrise Beach, MO. 65079